Cannot execute the "nexttile" function.
4 次查看(过去 30 天)
显示 更早的评论
I tried to code for tiled plots as I was learning the tiledlayout/nexttile function. Although the code ran fine initially, it now shows error in ''nexttile'' function as follows:
Error in nexttile
Error in plot_run (line 10)
nexttile
My code was as follows:
tiledlayout(2,2);
x= linspace(0, 180);
y1= sin(x);
y2= cos(x);
y3= sin(x) + 2;
y4= cos(x)+2;
y5= tan(x);
nexttile
plot(x,y1)
ylabel("abra")
xlabel("speed")
hold on
plot(x,y5);
legend("GABA", "Glx")
ylabel("kadabra")
xlabel("speed")
hold off
nexttile
plot(x,y2)
ylabel("eeni")
xlabel("speed")
nexttile
plot(x,y3)
ylabel("meeinie")
xlabel("speed")
nexttile
plot(x,y4)
ylabel("mainie")
xlabel("speed")
1 个评论
Rik
2023-3-1
If you format your code as code, you can run it through the forum interface, making sure we can see the full error message. I suspect this code will run fine of its own, so the full error (all the red text) is important information.
回答(1 个)
DUY Nguyen
2023-3-2
Hi, I run the above code normally. "Make sure to keep the tiled layout axes open and active before calling the nexttile function.
tiledlayout(2,2);
x= linspace(0, 180);
y1= sin(x);
y2= cos(x);
y3= sin(x) + 2;
y4= cos(x)+2;
y5= tan(x);
nexttile
plot(x,y1)
ylabel("abra")
xlabel("speed")
hold on
plot(x,y5);
legend("GABA", "Glx")
ylabel("kadabra")
xlabel("speed")
hold off
nexttile
plot(x,y2)
ylabel("eeni")
xlabel("speed")
nexttile
plot(x,y3)
ylabel("meeinie")
xlabel("speed")
nexttile
plot(x,y4)
ylabel("mainie")
xlabel("speed")
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!