Clear Filters
Clear Filters

Trying to generate subplot figure

2 views (last 30 days)
Recieving index error attempting to create a figure, how do I fix/why is this happening?
Index in position 1 exceeds array bounds. Index must not exceed 1.
Error in getFileSummary (line 2)
fileSummary=figure('Name','File Summary','WindowState','normal','Visible','on');
  1 Comment
Nicholas Kavouris
Nicholas Kavouris on 11 Jan 2023
Here is a snippet of the beginning of the code
fileSummary=figure('Name','File Summary','WindowState','normal','Visible','on');
grid on;
xlabel('Time (s)');
yyaxis left;
plot(cookdata.TempF,'Color','r','LineWidth',1,"DisplayName","Probe Temp F");
hold on;
ylabel('Temperature (F)',Color="r");
yyaxis right;
ylabel('PWM/100 || RPM','Color','#FAA533');
plot(cookdata.AugerPWM./100,'LineStyle','-','Color','#FAA533',"DisplayName","Auger PWM");
plot(cookdata.AugerRPM./1000,'LineStyle','-','Color','#21ABDE',"DisplayName","Auger RPM");
plot(cookdata.FanPWM./100,'LineStyle','-','Color','#94918D',"DisplayName","Fan PWM");

Sign in to comment.

Accepted Answer

Les Beckham
Les Beckham on 11 Jan 2023
It looks like you have created a variable named figure.
Type the following command at your command prompt:
which -all figure
built-in (/MATLAB/toolbox/matlab/graphics/figure)
If the output shows a line that says "figure is a variable", you should clear that variable and change whatever code created that variable to use a different name.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!