subplot code in matlab

4 views (last 30 days)
Sarah Yun
Sarah Yun on 29 Dec 2019
Answered: John D'Errico on 29 Dec 2019
What is subplot code to make 3 graphs show like
X X X
where X is graph
thank you

Accepted Answer

John D'Errico
John D'Errico on 29 Dec 2019
This should be in the help for subplot. You want to create a 1x3 array of subplots.
subplot(1,3,1)
plot(rand(5),'.')
subplot(1,3,2)
plot(rand(5),'.')
subplot(1,3,3)
plot(rand(5),'.')
Of course, you could use a loop too, but the above is the simplest form.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!