Can I plot semilogx, semilogy, loglog plots simultaneously by writing in code in a single m file?

16 visualizzazioni (ultimi 30 giorni)
I have the following code in an m file :
x = linspace(0,10);
y=x.^3;
semilogx(x,y);
semilogy(x,y);
loglog(x,y);
This gives the last plot only. How do I get the rest of the plots?

Risposta accettata

Stephen23
Stephen23 il 30 Gen 2016
Modificato: Stephen23 il 30 Gen 2016
You could use figure to create three separate figures:
x = linspace(0,10);
y=x.^3;
figure()
semilogx(x,y);
figure()
semilogy(x,y);
figure()
loglog(x,y);
Or alternatively three subplots on one figure using subplot:
figure()
subplot(2,2,1)
semilogx(x,y);
subplot(2,2,2)
semilogy(x,y);
subplot(2,2,3)
loglog(x,y);

Più risposte (0)

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by