>> x=[1 2 3 4] x = 1 2 3 4 >> y=[0 2 1 1 3] y = 0 2 1 1 3 >> y(end)=[] y = 0 2 1 1 >> x x = 1 2 3 4 >> y y = 0 2 1 1 >> plot(x,y) >> plot(x,y,'ro') >> plot(x,y,'ro-') >> x=-4:4 x = -4 -3 -2 -1 0 1 2 3 4 >> y=x^2 Error using ^ Inputs must be a scalar and a square matrix. To compute elementwise POWER, use POWER (.^) instead. >> y=x.^2 y = 16 9 4 1 0 1 4 9 16 >> plot(x,y) >> plot(x,y,'o-') >> x=-4:0.1:4; >> x=-4:4 x = -4 -3 -2 -1 0 1 2 3 4 >> x1=-4:0.1:4; >> y=x1.^2; >> y=x.^2 y = 16 9 4 1 0 1 4 9 16 >> y1=x1.^2; >> plot(x1,y1) >> plot(x1,y1,'-o') >> y2=sin(x1); >> plot(x1,y2) >> plot(x,y,x1,y2) >> plot(x,y,x1,y2,x1,y1) >> plot(x1,y2) >> plot(x1,y1) >> plot(x1,y2) >> hold on >> plot(x1,y1) >> plot(x,y) >> plot(x,y+1) >> hold off >> plot(x,y) >> plot(x1,y1,'b') >> plot(x1,y1,'r') >> plot(x1,y1,'g') >> plot(x1,y1,'k') >> plot(x1,y1,'m') >> plot(x1,y1,'y') >> plot(x1,y1,'n') Error using plot Error in color/linetype argument >> plot(x1,y1,'c') >> plot(x1,y1,'-') >> plot(x1,y1,'--') >> plot(x1,y1,'-.') >> plot(x1,y1,':') >> plot(x1,y1,'o') >> plot(x1,y1,'p') >> plot(x1,y1,'d') >> plot(x1,y1,'s') >> plot(x1,y1,'*') >> plot(x1,y1,'<') >> plot(x1,y1,'.') >> plot(x,y,'r--*') >> plot(x,y,'r--*',x1,y2,'c:') >> plot(x,y,'r--*',x1,y2,'k:*') >> plot(x,y,'r:*',x1,y2,'kp') >> plot(x,y,'r:*',x1,y2,'kp') >> xlabel('speed m/s') >> ylabel('a m/s^2') >> title('sample plot in ahrar') >> legend('sample plot 1','sin(x)') >> fplot(@(x) x.^2) Error using fplot (line 52) Not enough input arguments. >> fplot(@(x) x.^2,-2,4) Index exceeds matrix dimensions. Error in fplot (line 96) xmin = min(lims(1:2)); xmax = max(lims(1:2)); >> fplot(@(x) x.^2,[-2,4]) >> fplot(@(x) x.*tan(1./x),[-2,4]) >> y3=sin(2*x1)+x1; >> plot(x1,y3) >> y3=sin(4*x1)+x1; >> plot(x1,y3) >> plot(x1,y3) >> figure >> plot(x,y,'r:*',x1,y2,'kp') >> figure >> plot(x,y,'r--*',x1,y2,'c:') >> figure(1) >> figure(2) >> sampleforplot >> sampleforplot >> sampleforplot >> sampleforplot >> sampleforplot >> sampleforplot Operation terminated by user during sampleforplot (line 6) sampleforplot Operation terminated by user during sampleforplot (line 6) sampleforplot >> sampleforplot >> plot(x,y,'r:*',x1,y2,'kp') >> axis([-1 2 -.5 .6]) >> axis([-1 2 -0.5 0.6]) >> plot(0,0,'kp') >> plot(0,0,'kp','markersize',70) >> plot(0,0,'kp','markersize',110) >> plot(0,0,'kp','markersize',110,'markerfacecolor','c') >> plot(0,0,'kp','markersize',110,'markerfacecolor','c','linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor','c','linewidth',5) >> hold on >> plot(0,0,'kp','markersize',70,'markerfacecolor','y','linewidth',1) >> plot(0,0,'kp','markersize',140,'markerfacecolor','c','linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[1 0 0],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[0 1 0],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[0 0 1],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[.5 0 .3],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[1 0 .3],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[1 0 1],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[.8 .1 .5],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[.8 .7 0],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[.7 .7 0],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[.7 .5 0],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[.9 .5 0],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[.4 .5 0],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[.7 .3 0],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[.7 .3 .14],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[0 1 1],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[1 .2 0],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[1 .1 0],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[1 .5 0],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[.85 .5 0],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[.85 .5 .3],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[.9 .5 .3],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[.9 .5 0],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[.9 .8 0],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[.9 .9 0],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[1 1 0],'linewidth',5) >> plot(0,0,'kp','markersize',140,'markerfacecolor',[1 1 0],'linewidth',5) >>