subplot index exceeds matrix dimensions
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Francisco Javier Espinosa Peláez
am 22 Dez. 2017
Beantwortet: Jingting Li
am 18 Mär. 2021
Hi, Im getting an error output: "Index exceeds matrix dimensions", when evaluating the "title" command (6th line). If I take the line out, the code runs and I get my subplots(4) correctly plotted, with the axis labels. What am I doing wrong?
Thanks in advance =)
figure
for i = 1:length(sol)
[X1,Y1]=meshgrid(0:1/(Nx(i)-1):1 ,0:1/(Ny(i)-1):1);
hold on
subplot(length(sol)-2,length(sol)-2,i)
title(strcat('Nx=',num2str(Nx(i))))
surf(X1,Y1,sol{1,i})
xlabel('x')
ylabel('y')
zlabel('T')
end
0 Kommentare
Antworten (1)
Jingting Li
am 18 Mär. 2021
I just run into the same problem and found out that I have a variable named "title". Just rename this variable and it'll be fine to run.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Subplots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!