y=[3,4,5,9,2] y = 3 4 5 9 2 plot(y) plot(y,'*') plot(y,'o') plot(y,'x') plot(y,'v') plot(y,'^') plot(y,'<') plot(y,'>') plot(y,'>-') help plot PLOT Linear plot. PLOT(X,Y) plots vector Y versus vector X. If X or Y is a matrix, then the vector is plotted versus the rows or columns of the matrix, whichever line up. If X is a scalar and Y is a vector, disconnected line objects are created and plotted as discrete points vertically at X. PLOT(Y) plots the columns of Y versus their index. If Y is complex, PLOT(Y) is equivalent to PLOT(real(Y),imag(Y)). In all other uses of PLOT, the imaginary part is ignored. Various line types, plot symbols and colors may be obtained with PLOT(X,Y,S) where S is a character string made from one element from any or all the following 3 columns: b blue . point - solid g green o circle : dotted r red x x-mark -. dashdot c cyan + plus -- dashed m magenta * star (none) no line y yellow s square k black d diamond w white v triangle (down) ^ triangle (up) < triangle (left) > triangle (right) p pentagram h hexagram For example, PLOT(X,Y,'c+:') plots a cyan dotted line with a plus at each data point; PLOT(X,Y,'bd') plots blue diamond at each data point but does not draw any line. PLOT(X1,Y1,S1,X2,Y2,S2,X3,Y3,S3,...) combines the plots defined by the (X,Y,S) triples, where the X's and Y's are vectors or matrices and the S's are strings. For example, PLOT(X,Y,'y-',X,Y,'go') plots the data twice, with a solid yellow line interpolating green circles at the data points. The PLOT command, if no color is specified, makes automatic use of the colors specified by the axes ColorOrder property. By default, PLOT cycles through the colors in the ColorOrder property. For monochrome systems, PLOT cycles over the axes LineStyleOrder property. Note that RGB colors in the ColorOrder property may differ from similarly-named colors in the (X,Y,S) triples. For example, the second axes ColorOrder property is medium green with RGB [0 .5 0], while PLOT(X,Y,'g') plots a green line with RGB [0 1 0]. If you do not specify a marker type, PLOT uses no marker. If you do not specify a line style, PLOT uses a solid line. PLOT(AX,...) plots into the axes with handle AX. PLOT returns a column vector of handles to lineseries objects, one handle per plotted line. The X,Y pairs, or X,Y,S triples, can be followed by parameter/value pairs to specify additional properties of the lines. For example, PLOT(X,Y,'LineWidth',2,'Color',[.6 0 0]) will create a plot with a dark red line width of 2 points. Example x = -pi:pi/10:pi; y = tan(sin(x)) - sin(tan(x)); plot(x,y,'--rs','LineWidth',2,... 'MarkerEdgeColor','k',... 'MarkerFaceColor','g',... 'MarkerSize',10) See also plottools, semilogx, semilogy, loglog, plotyy, plot3, grid, title, xlabel, ylabel, axis, axes, hold, legend, subplot, scatter. Overloaded methods: timeseries/plot phytree/plot clustergram/plot HeatMap/plot channel.plot sfit/plot cfit/plot fints/plot idmodel/plot idfrd/plot iddata/plot idnlhw/plot idnlarx/plot dspdata.plot wdectree/plot ntree/plot dtree/plot wvtree/plot rwvtree/plot edwttree/plot Reference page in Help browser doc plot plot(y,'r>-') x=0:2*pi x = 0 1 2 3 4 5 6 y=sin(x) y = Columns 1 through 6 0 0.8415 0.9093 0.1411 -0.7568 -0.9589 Column 7 -0.2794 plot(x,y,'k') plot(x,y,'k*') x=0:0.1:2*pi x = Columns 1 through 6 0 0.1000 0.2000 0.3000 0.4000 0.5000 Columns 7 through 12 0.6000 0.7000 0.8000 0.9000 1.0000 1.1000 Columns 13 through 18 1.2000 1.3000 1.4000 1.5000 1.6000 1.7000 Columns 19 through 24 1.8000 1.9000 2.0000 2.1000 2.2000 2.3000 Columns 25 through 30 2.4000 2.5000 2.6000 2.7000 2.8000 2.9000 Columns 31 through 36 3.0000 3.1000 3.2000 3.3000 3.4000 3.5000 Columns 37 through 42 3.6000 3.7000 3.8000 3.9000 4.0000 4.1000 Columns 43 through 48 4.2000 4.3000 4.4000 4.5000 4.6000 4.7000 Columns 49 through 54 4.8000 4.9000 5.0000 5.1000 5.2000 5.3000 Columns 55 through 60 5.4000 5.5000 5.6000 5.7000 5.8000 5.9000 Columns 61 through 63 6.0000 6.1000 6.2000 x=0:0.1:2*pi; y=sin(x); plot(x,y,'k') plot(x,y,'k.') y2=cos(x); plot(x,y,'m') y2 y2 = Columns 1 through 6 1.0000 0.9950 0.9801 0.9553 0.9211 0.8776 Columns 7 through 12 0.8253 0.7648 0.6967 0.6216 0.5403 0.4536 Columns 13 through 18 0.3624 0.2675 0.1700 0.0707 -0.0292 -0.1288 Columns 19 through 24 -0.2272 -0.3233 -0.4161 -0.5048 -0.5885 -0.6663 Columns 25 through 30 -0.7374 -0.8011 -0.8569 -0.9041 -0.9422 -0.9710 Columns 31 through 36 -0.9900 -0.9991 -0.9983 -0.9875 -0.9668 -0.9365 Columns 37 through 42 -0.8968 -0.8481 -0.7910 -0.7259 -0.6536 -0.5748 Columns 43 through 48 -0.4903 -0.4008 -0.3073 -0.2108 -0.1122 -0.0124 Columns 49 through 54 0.0875 0.1865 0.2837 0.3780 0.4685 0.5544 Columns 55 through 60 0.6347 0.7087 0.7756 0.8347 0.8855 0.9275 Columns 61 through 63 0.9602 0.9833 0.9965 plot(x,y2,'m') 'retezec v MATLABu' ans = retezec v MATLABu r='retezec v MATLABu' r = retezec v MATLABu r(3) ans = t r(end) ans = u r(7:end) ans = c v MATLABu z='a' z = a z+5 ans = 102 c='7' c = 7 d=7 d = 7 d+1 ans = 8 c+1 ans = 56 whos Name Size Bytes Class Attributes ans 1x1 8 double c 1x1 2 char d 1x1 8 double r 1x17 34 char x 1x63 504 double y 1x63 504 double y2 1x63 504 double z 1x1 2 char r r = retezec v MATLABu r(end:-1:1) ans = uBALTAM v cezeter size(r) ans = 1 17 length(r) ans = 17 a=[1:4,5:-1:1] a = 1 2 3 4 5 4 3 2 1 size(a) ans = 1 9 length(a) ans = 9 b=[1;5;9;8;-3] b = 1 5 9 8 -3 size(b) ans = 5 1 length(b) ans = 5 A=[4:8;8:-1:4;0:2:8;5,6,9,-1,0] A = 4 5 6 7 8 8 7 6 5 4 0 2 4 6 8 5 6 9 -1 0 size(A) ans = 4 5 length(A) ans = 5 A(3,4) ans = 6 A A = 4 5 6 7 8 8 7 6 5 4 0 2 4 6 8 5 6 9 -1 0 A(2,:) ans = 8 7 6 5 4 A(2,1:5) ans = 8 7 6 5 4 A(:,3) ans = 6 6 4 9 A(1:3,1:2) ans = 4 5 8 7 0 2 A A = 4 5 6 7 8 8 7 6 5 4 0 2 4 6 8 5 6 9 -1 0 A(3:end,2:end) ans = 2 4 6 8 6 9 -1 0 [r,s]=size(A) r = 4 s = 5 A A = 4 5 6 7 8 8 7 6 5 4 0 2 4 6 8 5 6 9 -1 0 A(r,:) ans = 5 6 9 -1 0 A(:,2:s) ans = 5 6 7 8 7 6 5 4 2 4 6 8 6 9 -1 0 A(:,:) ans = 4 5 6 7 8 8 7 6 5 4 0 2 4 6 8 5 6 9 -1 0 B=A B = 4 5 6 7 8 8 7 6 5 4 0 2 4 6 8 5 6 9 -1 0 B(3,4)=-6 B = 4 5 6 7 8 8 7 6 5 4 0 2 4 -6 8 5 6 9 -1 0 B(1:2,1:2)=10 B = 10 10 6 7 8 10 10 6 5 4 0 2 4 -6 8 5 6 9 -1 0 B(4,3:end)=20 B = 10 10 6 7 8 10 10 6 5 4 0 2 4 -6 8 5 6 20 20 20 B(7,6)=80 B = 10 10 6 7 8 0 10 10 6 5 4 0 0 2 4 -6 8 0 5 6 20 20 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 80 size(A) ans = 4 5 size(b) ans = 5 1 size(B) ans = 7 6 B B = 10 10 6 7 8 0 10 10 6 5 4 0 0 2 4 -6 8 0 5 6 20 20 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 80 B(7,:)=[] B = 10 10 6 7 8 0 10 10 6 5 4 0 0 2 4 -6 8 0 5 6 20 20 20 0 0 0 0 0 0 0 0 0 0 0 0 0 size(B) ans = 6 6 B(end,:)=[] B = 10 10 6 7 8 0 10 10 6 5 4 0 0 2 4 -6 8 0 5 6 20 20 20 0 0 0 0 0 0 0 size(B) ans = 5 6 B(end,:)=[] B = 10 10 6 7 8 0 10 10 6 5 4 0 0 2 4 -6 8 0 5 6 20 20 20 0 size(B) ans = 4 6 B(:,5:6)=[] B = 10 10 6 7 10 10 6 5 0 2 4 -6 5 6 20 20 size(B) ans = 4 4 B' ans = 10 10 0 5 10 10 2 6 6 6 4 20 7 5 -6 20 B.' ans = 10 10 0 5 10 10 2 6 6 6 4 20 7 5 -6 20 A A = 4 5 6 7 8 8 7 6 5 4 0 2 4 6 8 5 6 9 -1 0 A.' ans = 4 8 0 5 5 7 2 6 6 6 4 9 7 5 6 -1 8 4 8 0 A' ans = 4 8 0 5 5 7 2 6 6 6 4 9 7 5 6 -1 8 4 8 0 size(A) ans = 4 5 size(A.') ans = 5 4 C=[1+2i,5-6i,4+3i;7+8j,9j,0-j] C = 1.0000 + 2.0000i 5.0000 - 6.0000i 4.0000 + 3.0000i 7.0000 + 8.0000i 0 + 9.0000i 0 - 1.0000i C.' ans = 1.0000 + 2.0000i 7.0000 + 8.0000i 5.0000 - 6.0000i 0 + 9.0000i 4.0000 + 3.0000i 0 - 1.0000i C' ans = 1.0000 - 2.0000i 7.0000 - 8.0000i 5.0000 + 6.0000i 0 - 9.0000i 4.0000 - 3.0000i 0 + 1.0000i size(C) ans = 2 3 size(C.') ans = 3 2 size(C') ans = 3 2 length(C) ans = 3 length(C.') ans = 3 A A = 4 5 6 7 8 8 7 6 5 4 0 2 4 6 8 5 6 9 -1 0 B B = 10 10 6 7 10 10 6 5 0 2 4 -6 5 6 20 20 b b = 1 5 9 8 -3 b(end)=[] b = 1 5 9 8 Q=[B,b] Q = 10 10 6 7 1 10 10 6 5 5 0 2 4 -6 9 5 6 20 20 8 R=[Q;A] R = 10 10 6 7 1 10 10 6 5 5 0 2 4 -6 9 5 6 20 20 8 4 5 6 7 8 8 7 6 5 4 0 2 4 6 8 5 6 9 -1 0 R = paralel(10,10) R = 5 R = paralel(10,4) R = 2.8571 R1=8; R2=6; R = paralel(R1,R2) R = 3.4286 x=5; y=6; R = paralel(x,y) R = 2.7273 clear % maze promenne R = paralel(10,10) R = 5 diary off