overwrite figure(2) on figure(1)
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MatLab open all the figure except for the number 2 and I can't understand why. In fact if I use:
figure
fplot(f,[-pi,pi])
figure
fplot(g)
it plot the first one in figure(1) and the second one in figure(3). If I would use this code it will overwrite on figure(1).
figure(1)
fplot(f,[-pi,pi])
%
figure(2)
fplot(g)
0 commentaires
Réponses (1)
Star Strider
le 2 Déc 2022
I am not certain what you are asking. Consider using the hold function to plot two figures on the same axes —
syms x
f = sin(x);
g = cos(x);
figure
fplot(f, [-pi pi], 'DisplayName','sin(x)')
hold on
fplot(g, [-pi pi], 'DisplayName','cos(x)')
hold off
grid
legend('Location','best')
.
0 commentaires
Voir également
Catégories
En savoir plus sur Graphics Object Programming dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!