12.04.2015 Views

Solving Problems in Dynamics and Vibrations Using MATLAB ...

Solving Problems in Dynamics and Vibrations Using MATLAB ...

Solving Problems in Dynamics and Vibrations Using MATLAB ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

10<br />

Figure Comm<strong>and</strong><br />

Suppose you want to plot two different vectors <strong>in</strong> two different w<strong>in</strong>dows, use the “figure”<br />

comm<strong>and</strong>. The example given below illustrates the use of the “figure” comm<strong>and</strong>.<br />

% to illustrate the figure comm<strong>and</strong><br />

x=[1,2,3,4,5,6,7,8,9,10];<br />

y=[12 23 4 5 65 67 89];<br />

figure(1)<br />

plot(x)<br />

grid<br />

title('plot of X')<br />

figure(2)<br />

plot(y)<br />

grid<br />

title('plot of Y')<br />

The above code will plot the values of x <strong>and</strong> y <strong>in</strong> two different figure w<strong>in</strong>dows. If you want to<br />

know more about the comm<strong>and</strong> type the follow<strong>in</strong>g at the comm<strong>and</strong> prompt.<br />

help figure

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!