Friday, 14 December 2018

How to plot multiple 2D graph in MATLAB ?

In the previous post, we have seen what are the steps to plot a 2D graph in MATLAB. Now let's see how to plot multiple 2D graphs by an example...

EXAMPLE :
Plot graphs of sinx and cosx from 0 to 2𝝿 on a single page using MATLAB.

solution :
 
    x=linspace(0,2*pi,50);
    y1=sin(x);
    y2=cos(x);
    plot(x,y1,x,y2)




No comments:

Post a Comment