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

16 visualizaciones (últimos 30 días)
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?

Respuesta aceptada

Stephen23
Stephen23 el 30 de En. de 2016
Editada: Stephen23 el 30 de En. de 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);

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by