Some times you want to many plots in same plots window with legend, at that time you have use this type of examples.Here we have used hold on command and also use drawnow used to plot two are more plot in same plot window.That example as follows
>> xdata = rand(10,1);
>> ydata = rand(10,1);
>> figure;
>> plot(xdata);
>> plot(xdata);
>> hold on
>> drawnow
>> xdata
>> plot(ydata,'color','red');
>> legend('Xdata','Ydata');
>> legend('Xdata','Ydata');
No comments:
Post a Comment