If we want the plot the variable at the first position, we need to give the third argument an integer 1. For example, Lets plot the above two graphs in the same figure using the subplot () function. See the code below. t -10.11; x sin(2pit); y cos(2pit); figure subplot(1,2,1) plot(x) subplot(1,2,2) plot(y) Output. Note Make sure that when you use the "hold" command to make multiple plots, you should specify the color andor line style in the plot command. Otherwise all the plots will be of the same default (blue) color and line style. Check this out. 1.4.1 Example a)Using the plot command for multiple plots, plot y sin(x) and y cos(x) on the same. Hi, use "to workspace" block to send both signals to the work space. Then in the command window use for example "plot (t1,x1,t2,x2)" to plot them on.
2. PLOT Our next command is plot (t ,
x); which makes a continuous time graph whose x-axis contains values of variable t and y-axis contains values of variable x. In general, to plot any graph we use the command plot (xfunction, yfunction). After this command we will get a cosine graph as shown in figure Figure 2 Use of. xlinspace(-1,1); plot(x,2x, x,4x, x,6x, x,8x, x,10x, . Once you change the colormap, it will keep that colormap for all subsequent 3D plots within the same figure
or MATLAB session until you use close, or open a new figure window. x,ymeshgrid(linspace(0,10)); z5sin(x).cos(y); ax1subplot(2,2,1); mesh. Step 1 We take variables and assign a value and plot 1 st signal. Step 2 Then we use to hold on to plot the 2 nd signal on the same axes but different colour or style. The steps for multiple plotting of the data using subplot statement- Step 1 Take the required signals. Step 2 Then we use a subplot statement with appropriate syntax