MATLAB: Plotting 2 vectors of different plot vector Hi, i got one vector that is 120 rows whilst the other is 60. How can i plot them in the same figure? Best Answer with hold on.figureplot(x1)hold onplot(x2) Related SolutionsMATLAB: Plot different parts of vector Hi Robin,The following code will provide what you are looking forM3 = rand(1,80);j = 1;str = [];for i = 1:20:80 hold on plot(M3(i:19+i)); % Update this to have 20 values, which is fixed to 1 in your code str = [str ["Graph " + num2str(j)]]; % To have different legend for each plot through string array j = j+1;endlegend(str)Hope this helps.Regards,Sriram MATLAB: Plotting different colours figure;hold onplot(1:100,x(1:100),'b-');plot(101:(101+597),x(101:(101+597)),'r-');%etc.They key is to use hold on with separate calls to plot. Or to do all of the plotting in one line with different markers:plot(x1,y1,'b-',x2,y2,'r-'); %etc. Related Question
Best Answer