uiopen('H:\PPEL_cviceni\PPEL_2016\Ctvrtek_9_10\Cviceni_PPEL_01',1)
y=[4,2,8,6,3]
y =
4 2 8 6 3
y=[4,2,8,6,3];
plot(y)
plot(y,'*')
plot(y,'o')
plot(y,'x')
plot(y,'v')
plot(y,'^')
plot(y,'<')
plot(y,'>')
plot(y,'>-')
plot(y,'r>-')
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
x=0:2*pi;
y=sin(x);
plot(x,y)
x
x =
0 1 2 3 4 5 6
x=0:0.1:2*pi;
y=sin(x);
plot(x,y)
plot(x,y,'.')
plot(x,y,'k.')
plot(x,y,'k*-.')
y2=cos(x);
plot(x,y2,'m:')
'retezec v MATLABu'
ans =
retezec v MATLABu
t='retezec v MATLABu'
t =
retezec v MATLABu
size(t)
ans =
1 17
t(5)
ans =
z
t(end)
ans =
u
t(5:end)
ans =
zec v MATLABu
t(1,end)
ans =
u
t([7,12,3])
ans =
cAt
t
t =
retezec v MATLABu
t(1,[7,12,3])
ans =
cAt
a='j'
a =
j
whos
Name Size Bytes Class Attributes
a 1x1 2 char
ans 1x3 6 char
t 1x17 34 char
x 1x63 504 double
y 1x63 504 double
y2 1x63 504 double
b=j
b =
0 + 1.0000i
whos
Name Size Bytes Class Attributes
a 1x1 2 char
ans 1x3 6 char
b 1x1 16 double complex
t 1x17 34 char
x 1x63 504 double
y 1x63 504 double
y2 1x63 504 double
c='5'
c =
5
d=5
d =
5
whos
Name Size Bytes Class Attributes
a 1x1 2 char
ans 1x3 6 char
b 1x1 16 double complex
c 1x1 2 char
d 1x1 8 double
t 1x17 34 char
x 1x63 504 double
y 1x63 504 double
y2 1x63 504 double
d+2
ans =
7
c+2
ans =
55
t
t =
retezec v MATLABu
t(end:-1:1)
ans =
uBALTAM v cezeter
size(t)
ans =
1 17
length(t)
ans =
17
f=[1:5,4:-1:1]
f =
1 2 3 4 5 4 3 2 1
size(f)
ans =
1 9
length(f)
ans =
9
f(6)
ans =
4
f(5:end)
ans =
5 4 3 2 1
g=[5;9;-3;4;6]
g =
5
9
-3
4
6
size(g)
ans =
5 1
length(g)
ans =
5
g(3,1)
ans =
-3
g(3)
ans =
-3
g(end)
ans =
6
g(2:5)
ans =
9
-3
4
6
A=[1:6;6:-1:1;0:2:10;-3,2,9,4,5,8]
A =
1 2 3 4 5 6
6 5 4 3 2 1
0 2 4 6 8 10
-3 2 9 4 5 8
size(A)
ans =
4 6
length(A)
ans =
6
A(3,4)
ans =
6
A
A =
1 2 3 4 5 6
6 5 4 3 2 1
0 2 4 6 8 10
-3 2 9 4 5 8
A(3,1:6)
ans =
0 2 4 6 8 10
A(3,:)
ans =
0 2 4 6 8 10
rot90(A)
ans =
6 1 10 8
5 2 8 5
4 3 6 4
3 4 4 9
2 5 2 2
1 6 0 -3
rot90(A,2)
ans =
8 5 4 9 2 -3
10 8 6 4 2 0
1 2 3 4 5 6
6 5 4 3 2 1
rot90(A,3)
ans =
-3 0 6 1
2 2 5 2
9 4 4 3
4 6 3 4
5 8 2 5
8 10 1 6
rot90(A,4)
ans =
1 2 3 4 5 6
6 5 4 3 2 1
0 2 4 6 8 10
-3 2 9 4 5 8
A'
ans =
1 6 0 -3
2 5 2 2
3 4 4 9
4 3 6 4
5 2 8 5
6 1 10 8
A.'
ans =
1 6 0 -3
2 5 2 2
3 4 4 9
4 3 6 4
5 2 8 5
6 1 10 8
size(A)
ans =
4 6
size(A')
ans =
6 4
size(A.')
ans =
6 4
C=[1+2i,3+4i,5-6i;7-8i,9+1i,j]
C =
1.0000 + 2.0000i 3.0000 + 4.0000i 5.0000 - 6.0000i
7.0000 - 8.0000i 9.0000 + 1.0000i 0 + 1.0000i
C.'
ans =
1.0000 + 2.0000i 7.0000 - 8.0000i
3.0000 + 4.0000i 9.0000 + 1.0000i
5.0000 - 6.0000i 0 + 1.0000i
C'
ans =
1.0000 - 2.0000i 7.0000 + 8.0000i
3.0000 - 4.0000i 9.0000 - 1.0000i
5.0000 + 6.0000i 0 - 1.0000i
C(:,2)
ans =
3.0000 + 4.0000i
9.0000 + 1.0000i
A
A =
1 2 3 4 5 6
6 5 4 3 2 1
0 2 4 6 8 10
-3 2 9 4 5 8
A(1:2,1:2)
ans =
1 2
6 5
A(5:end,3:end)
ans =
Empty matrix: 0-by-4
A(3:end,5:end)
ans =
8 10
5 8
A
A =
1 2 3 4 5 6
6 5 4 3 2 1
0 2 4 6 8 10
-3 2 9 4 5 8
A(3,3)=40
A =
1 2 3 4 5 6
6 5 4 3 2 1
0 2 40 6 8 10
-3 2 9 4 5 8
A(1:2,1:3)=20
A =
20 20 20 4 5 6
20 20 20 3 2 1
0 2 40 6 8 10
-3 2 9 4 5 8
A(:,[4,6])=50
A =
20 20 20 50 5 50
20 20 20 50 2 50
0 2 40 50 8 50
-3 2 9 50 5 50
A(8,7)=100
A =
20 20 20 50 5 50 0
20 20 20 50 2 50 0
0 2 40 50 8 50 0
-3 2 9 50 5 50 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 100
B=A
B =
20 20 20 50 5 50 0
20 20 20 50 2 50 0
0 2 40 50 8 50 0
-3 2 9 50 5 50 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 100
size(A)
ans =
8 7
size(b)
ans =
1 1
size(B)
ans =
8 7
A
A =
20 20 20 50 5 50 0
20 20 20 50 2 50 0
0 2 40 50 8 50 0
-3 2 9 50 5 50 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 100
A(end,:)=[]
A =
20 20 20 50 5 50 0
20 20 20 50 2 50 0
0 2 40 50 8 50 0
-3 2 9 50 5 50 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
size(A)
ans =
7 7
20 20 20
??? 20 20 20
|
{Error: Unexpected MATLAB expression.
}
A(:,1:3)=[]
A =
50 5 50 0
50 2 50 0
50 8 50 0
50 5 50 0
0 0 0 0
0 0 0 0
0 0 0 0
size(A)
ans =
7 4
A([2:2:end],:)
ans =
50 2 50 0
50 5 50 0
0 0 0 0
A
A =
50 5 50 0
50 2 50 0
50 8 50 0
50 5 50 0
0 0 0 0
0 0 0 0
0 0 0 0
A([2:2:end],:)=[]
A =
50 5 50 0
50 8 50 0
0 0 0 0
0 0 0 0
size(A)
ans =
4 4
R= paralel(100,100)
R =
50
R= paralel(100,40)
R =
28.5714
R1=8;
R2=12;
R= paralel(R1,R2)
R =
4.8000
x=5;
y=10;
R= paralel(x,y)
R =
3.3333
help paralel
paraleni zapojeni dvou odporu
clear a
clear
R= paralel(100,100)
R =
50
diary off