Professional Documents
Culture Documents
Spring 23 Group 1 Data Comm.
Spring 23 Group 1 Data Comm.
A =
1 2 3
8 6 4
3 6 9
>> B = [1 2 3 4 5; 2 5 8 9]
Dimensions of matrices being concatenated are not
consistent.
>> B = [1 2 3 4 5; 2 4 6 8 7]
B =
1 2 3 4 5
2 4 6 8 7
ans =
17
>> C = [1 2; 3 4; 5 6; 7 8; 9 10 ]
C =
1 2
3 4
5 6
7 8
9 10
ans =
18
ans =
144
>> A(1:2,1:3)
ans =
1 2 3
8 6 4
>> C(1:2;1:2)
C(1:2;1:2)
↑
Error: Unbalanced or unexpected parenthesis or
bracket.
>> C(1:2,1:2)
ans =
1 2
3 4
>>
>> A(:,23)
Index exceeds matrix dimensions.
>> A(:,3)
ans =
3
4
9
>> A(3,:)
ans =
3 6 9
V =
Columns 1 through 8
100 95 90 85 80 75 70 65
Columns 9 through 16
60 55 50 45 40 35 30 25
Columns 17 through 19
20 15 10
>> X=(0:2:10)
X =
0 2 4 6 8 10
>> X(0:10)
Subscript indices must either be real positive
integers or logicals.
>> x(0:10)
Undefined function or variable 'x'.
X =
Columns 1 through 8
0 1 2 3 4 5 6 7
Columns 9 through 11
8 9 10
>> F=(10:0)
F =
>> F(0:5:27)
Subscript indices must either be real positive
integers or logicals.
>> D=(0:2:13)
D =
0 2 4 6 8 10 12
>> xx=zeros(3,4)
xx =
0 0 0 0
0 0 0 0
0 0 0 0
>> yy=ones(2,2)
yy =
1 1
1 1
>> ss=ones(3,3)*8
ss =
8 8 8
8 8 8
8 8 8
>> cc=rand(4,4)
cc =
>> dd=randn(2,5)
dd =
>> oo=rand(2,2)*1000
oo =
743.1325 655.4779
392.2270 171.1867
>> clc