Effacer les filtres
Effacer les filtres

Cannot execute the "nexttile" function.

7 vues (au cours des 30 derniers jours)
Waqar
Waqar le 1 Mar 2023
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 commentaire
Rik
Rik le 1 Mar 2023
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.

Connectez-vous pour commenter.

Réponses (1)

DUY Nguyen
DUY Nguyen le 2 Mar 2023
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")

Catégories

En savoir plus sur Dialog Boxes dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by