A=[1,2,3,4;5,6,7,8,i,2+3i,-i,10]
{??? Error using ==> vertcat
CAT arguments dimensions are not consistent.
}
A=[1,2,3,4;5,6,7,8;i,2+3i,-i,10]
A =
1.0000 2.0000 3.0000 4.0000
5.0000 6.0000 7.0000 8.0000
0 + 1.0000i 2.0000 + 3.0000i 0 - 1.0000i 10.0000
whos
Name Size Bytes Class Attributes
A 3x4 192 double complex
A(2,3)
ans =
7
A(2,3)*10
ans =
70
A(2,3)=-7
A =
1.0000 2.0000 3.0000 4.0000
5.0000 6.0000 -7.0000 8.0000
0 + 1.0000i 2.0000 + 3.0000i 0 - 1.0000i 10.0000
A(2,:)
ans =
5 6 -7 8
A(:,3)
ans =
3.0000
-7.0000
0 - 1.0000i
a=[1:7]
a =
1 2 3 4 5 6 7
b=90:103
b =
Columns 1 through 12
90 91 92 93 94 95 96 97 98 99 100 101
Columns 13 through 14
102 103
c=6:2
c =
Empty matrix: 1-by-0
d=6:-1:2
d =
6 5 4 3 2
d=6:-0.5:2
d =
Columns 1 through 7
6.0000 5.5000 5.0000 4.5000 4.0000 3.5000 3.0000
Columns 8 through 9
2.5000 2.0000
d=6:2:2
d =
Empty matrix: 1-by-0
d=6:-2:2
d =
6 4 2
e=1:3:12
e =
1 4 7 10
A
A =
1.0000 2.0000 3.0000 4.0000
5.0000 6.0000 -7.0000 8.0000
0 + 1.0000i 2.0000 + 3.0000i 0 - 1.0000i 10.0000
B=[A;e]
B =
1.0000 2.0000 3.0000 4.0000
5.0000 6.0000 -7.0000 8.0000
0 + 1.0000i 2.0000 + 3.0000i 0 - 1.0000i 10.0000
1.0000 4.0000 7.0000 10.0000
C=[B;[1:4]]
C =
1.0000 2.0000 3.0000 4.0000
5.0000 6.0000 -7.0000 8.0000
0 + 1.0000i 2.0000 + 3.0000i 0 - 1.0000i 10.0000
1.0000 4.0000 7.0000 10.0000
1.0000 2.0000 3.0000 4.0000
C(2:4,:)
ans =
5.0000 6.0000 -7.0000 8.0000
0 + 1.0000i 2.0000 + 3.0000i 0 - 1.0000i 10.0000
1.0000 4.0000 7.0000 10.0000
C(:,1:2)
ans =
1.0000 2.0000
5.0000 6.0000
0 + 1.0000i 2.0000 + 3.0000i
1.0000 4.0000
1.0000 2.0000
C(2:4,1:2)
ans =
5.0000 6.0000
0 + 1.0000i 2.0000 + 3.0000i
1.0000 4.0000
C
C =
1.0000 2.0000 3.0000 4.0000
5.0000 6.0000 -7.0000 8.0000
0 + 1.0000i 2.0000 + 3.0000i 0 - 1.0000i 10.0000
1.0000 4.0000 7.0000 10.0000
1.0000 2.0000 3.0000 4.0000
1:2:5
ans =
1 3 5
C(1:3:5,:)
ans =
1 2 3 4
1 4 7 10
C(1:2:5,:)
ans =
1.0000 2.0000 3.0000 4.0000
0 + 1.0000i 2.0000 + 3.0000i 0 - 1.0000i 10.0000
1.0000 2.0000 3.0000 4.0000
C(:,[1,3,4])
ans =
1.0000 3.0000 4.0000
5.0000 -7.0000 8.0000
0 + 1.0000i 0 - 1.0000i 10.0000
1.0000 7.0000 10.0000
1.0000 3.0000 4.0000
C([1,2,5],:)
ans =
1 2 3 4
5 6 -7 8
1 2 3 4
whos
Name Size Bytes Class Attributes
A 3x4 192 double complex
B 4x4 256 double complex
C 5x4 320 double complex
a 1x7 56 double
ans 3x4 96 double
b 1x14 112 double
c 1x0 0 double
d 1x3 24 double
e 1x4 32 double
size(C)
ans =
5 4
whos
Name Size Bytes Class Attributes
A 3x4 192 double complex
B 4x4 256 double complex
C 5x4 320 double complex
a 1x7 56 double
ans 1x2 16 double
b 1x14 112 double
c 1x0 0 double
d 1x3 24 double
e 1x4 32 double
v=size(C)
v =
5 4
[r,s]=size(C)
r =
5
s =
4
help size
SIZE Size of array.
D = SIZE(X), for M-by-N matrix X, returns the two-element row vector
D = [M,N] containing the number of rows and columns in the matrix.
For N-D arrays, SIZE(X) returns a 1-by-N vector of dimension lengths.
Trailing singleton dimensions are ignored.
[M,N] = SIZE(X) for matrix X, returns the number of rows and columns in
X as separate output variables.
[M1,M2,M3,...,MN] = SIZE(X) for N>1 returns the sizes of the first N
dimensions of the array X. If the number of output arguments N does
not equal NDIMS(X), then for:
N > NDIMS(X), SIZE returns ones in the "extra" variables, i.e., outputs
NDIMS(X)+1 through N.
N < NDIMS(X), MN contains the product of the sizes of dimensions N
through NDIMS(X).
M = SIZE(X,DIM) returns the length of the dimension specified
by the scalar DIM. For example, SIZE(X,1) returns the number
of rows. If DIM > NDIMS(X), M will be 1.
When SIZE is applied to a Java array, the number of rows
returned is the length of the Java array and the number of columns
is always 1. When SIZE is applied to a Java array of arrays, the
result describes only the top level array in the array of arrays.
Example:
If
X = rand(2,3,4);
then
d = size(X) returns d = [2 3 4]
[m1,m2,m3,m4] = size(X) returns m1 = 2, m2 = 3, m3 = 4, m4 = 1
[m,n] = size(X) returns m = 2, n = 12
m2 = size(X,2) returns m2 = 3
See also length, ndims, numel.
Overloaded methods:
TriRep/size
timer/size
serial/size
tscollection/size
gf/size
InputOutputModel/size
daqdevice/size
daqchild/size
distributed/size
codistributed/size
Composite/size
fints/size
idmodel/size
idfrd/size
iddata/size
idnlmodel/size
idnlgrey/size
idnlfun/size
videosource/size
videoinput/size
dataset/size
categorical/size
sym/size
Reference page in Help browser
doc size
C
C =
Columns 1 through 3
1.0000 2.0000 3.0000
5.0000 6.0000 -7.0000
0 + 1.0000i 2.0000 + 3.0000i 0 - 1.0000i
1.0000 4.0000 7.0000
1.0000 2.0000 3.0000
Column 4
4.0000
8.0000
10.0000
10.0000
4.0000
C
C =
1.0000 2.0000 3.0000 4.0000
5.0000 6.0000 -7.0000 8.0000
0 + 1.0000i 2.0000 + 3.0000i 0 - 1.0000i 10.0000
1.0000 4.0000 7.0000 10.0000
1.0000 2.0000 3.0000 4.0000
C(5,:)=[]
C =
1.0000 2.0000 3.0000 4.0000
5.0000 6.0000 -7.0000 8.0000
0 + 1.0000i 2.0000 + 3.0000i 0 - 1.0000i 10.0000
1.0000 4.0000 7.0000 10.0000
size(C)
ans =
4 4
C(:,2:3)
ans =
2.0000 3.0000
6.0000 -7.0000
2.0000 + 3.0000i 0 - 1.0000i
4.0000 7.0000
C
C =
1.0000 2.0000 3.0000 4.0000
5.0000 6.0000 -7.0000 8.0000
0 + 1.0000i 2.0000 + 3.0000i 0 - 1.0000i 10.0000
1.0000 4.0000 7.0000 10.0000
C(:,2:3)=[]
C =
1.0000 4.0000
5.0000 8.0000
0 + 1.0000i 10.0000
1.0000 10.0000
size(C)
ans =
4 2
D=C
D =
1.0000 4.0000
5.0000 8.0000
0 + 1.0000i 10.0000
1.0000 10.0000
C(1,:)=[]
C =
5.0000 8.0000
0 + 1.0000i 10.0000
1.0000 10.0000
D
D =
1.0000 4.0000
5.0000 8.0000
0 + 1.0000i 10.0000
1.0000 10.0000
a
a =
1 2 3 4 5 6 7
a(1,4)
ans =
4
a(4)
ans =
4
a(5:7)
ans =
5 6 7
a(5:end)
ans =
5 6 7
D
D =
1.0000 4.0000
5.0000 8.0000
0 + 1.0000i 10.0000
1.0000 10.0000
D(2:end,:)
ans =
5.0000 8.0000
0 + 1.0000i 10.0000
1.0000 10.0000
a
a =
1 2 3 4 5 6 7
a([2,4,7])
ans =
2 4 7
a(end:-1:1)
ans =
7 6 5 4 3 2 1
D
D =
1.0000 4.0000
5.0000 8.0000
0 + 1.0000i 10.0000
1.0000 10.0000
D(end:-1:1,:)
ans =
1.0000 10.0000
0 + 1.0000i 10.0000
5.0000 8.0000
1.0000 4.0000
'ahoj'
ans =
ahoj
t='ahoj'
t =
ahoj
whos
Name Size Bytes Class Attributes
A 3x4 192 double complex
B 4x4 256 double complex
C 3x2 96 double complex
D 4x2 128 double complex
a 1x7 56 double
ans 1x4 8 char
b 1x14 112 double
c 1x0 0 double
d 1x3 24 double
e 1x4 32 double
r 1x1 8 double
s 1x1 8 double
t 1x4 8 char
v 1x2 16 double
u='a'
u =
a
v='2'
v =
2
v+1
ans =
51
u+1
ans =
98
whos
Name Size Bytes Class Attributes
A 3x4 192 double complex
B 4x4 256 double complex
C 3x2 96 double complex
D 4x2 128 double complex
a 1x7 56 double
ans 1x1 8 double
b 1x14 112 double
c 1x0 0 double
d 1x3 24 double
e 1x4 32 double
r 1x1 8 double
s 1x1 8 double
t 1x4 8 char
u 1x1 2 char
v 1x1 2 char
t
t =
ahoj
t(2)
ans =
h
t(3)
ans =
o
t(end)
ans =
j
t(2:4)
ans =
hoj
t(end:-1:1)
ans =
joha
3+5
ans =
8
x=5+8;
y=4+6;
z=y+x
z =
23
who
Your variables are:
A C a b d r t v y
B D ans c e s u x z
5^2
ans =
25
2^3
ans =
8
R = paralel_zapojeni(6,10)
R =
3.7500
R = paralel_zapojeni(10,10)
R =
5
R1=9;R2=6;
R = paralel_zapojeni(R1,R2)
R =
3.6000
R = seriove_zapojeni(R1,R2)
R =
15
R = seriove_zapojeni(4,10)
R =
14