MATLAB: How to input multiple lines on a graph excelline graph I imported my data from excel, and i want to compare to different y values on a line graph. How to i add the second y value Best Answer In order to place mutliple plot on same figure we can use hold on functionalityAs a example x = linspace(-pi,pi);y1 = sin(x);y2 = cos(x);plot(x,y1); % first linehold on plot(x,y2); % second linehold off Related SolutionsMATLAB: Plot two grafphs at the same figure You have to read about hold onclc; clear allx = linspace(-pi,pi);y1 = sin(x);y2 = cos(x);plot(x,y1)hold onplot(x,y2)xlabel('x-axes')ylabel('y-axes') MATLAB: Need help graphing this x = 0:0.01:4*pi;plot(x,cos(x));hold on;plot(x,5+cos(x));ylim([-2 7]) Related QuestionHow to plot a number of curves on the same plotI have MatlabR2019b and I am trying to do a simple plot. I am not able to plot anything unless I use scatter(x,y) or area(x,y). How could I get plot(x,y) to work? I am using a Mac.
Best Answer