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

조회 수: 16 (최근 30일)
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?

채택된 답변

Stephen23
Stephen23 2016년 1월 30일
편집: Stephen23 2016년 1월 30일
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);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by