Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

subplot in matlab

Asked by Pg

Pg

on 12 Aug 2011

how to plot 9x3 subplot using subplot command plz, let me know.

0 Comments

Pg

Pg

Tags

Products

No products are associated with this question.

3 Answers

Answer by Friedrich

Friedrich

on 12 Aug 2011

Hi,

do you mean this:

subplot(9,3,1)
plot(1:10)
subplot(9,3,2)
plot(1:10)
%...and so on and finally
subplot(9,3,27)
plot(1:10)

0 Comments

Friedrich

Friedrich

Answer by Jan Simon

Jan Simon

on 13 Aug 2011

Please read:

help subplot
doc subplot

0 Comments

Jan Simon

Jan Simon

Answer by Vivek Bhadouria

Vivek Bhadouria

on 14 Aug 2011

Dear pg,

With 9*3 subplot,you will get 27 plots in a single window. Let us assume you want to plot some signals (vectors) located in your workspace named as a,b,c........z (if you are working with images then use imshow command to show an image in subplot). You can create 9*3 subplot as

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

subplot(9,3,1);plot(a);

subplot(9,3,2);plot(b);

subplot(9,3,3);plot(c);

subplot(9,3,4);plot(d);

subplot(9,3,5);plot(e);

.

.

.

.

.

subplot(9,3,26);plot(z);

subplot(9,3,27);plot(some_other_variable)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

In subplot 9*3 means,the window will be having 9 rows and 3 columns so making total of 27 subplots.

0 Comments

Vivek Bhadouria

Vivek Bhadouria

Contact us