Professional Documents
Culture Documents
ans =
>> 55-16
ans =
39
>> ans+11
ans =
50
>> 4*10
ans =
40
>> 100/4
ans =
25
>> sqrt(25)
ans =
>> sqrt(-10)
ans =
0.0 + 3.1623i
>> 2^3
ans =
>> 8^(1/3)
ans =
>> a=4
a=
>> A=6
A=
>> a
a=
>> A=6;
>> a=4,A=6;x=1;
a=
>> pi
ans =
3.1416
>> pi
ans =
3.141592653589793
>> cos(0)
ans =
>> cos(pi/3)
ans =
0.5000
>> a=[1 2 3 4 5]
a=
1 2 3 4 5
>> b=[2;4;6;8;10]
b=
10
b=
8
10
>> A=[1 2 3; 4 5 6; 7 8 9]
A=
1 2 3
4 5 6
7 8 9
>> A=[1 2 3
456
7 8 9]
A=
1 2 3
4 5 6
7 8 9
>> who
A U ans t y
E a b x y2
>> whos
A 3x3 72 double
E 2x3 48 double
U 1x3 24 double
a 1x5 40 double
b 5x1 40 double
t 1x6 48 double
x 1x1 8 double
y 1x201 1608 double
>> b(4)
ans =
>> A(2,3)
ans =
E=
0 0 0
0 0 0
U=
1 1 1
>> t=1:5
t=
10 9 8 7 6 5
t = 1 : 0.5 : 5
t=
1 2 3 4 5
>> t = 1 : 0.5 : 5
t=
Columns 1 through 3
Columns 4 through 6
Columns 7 through 9
>> t = 10 : -1 :5
t=
10 9 8 7 6 5
>> A(2,:)
ans =
4 5 6
>> A(:,1)
ans =
>> t (2:4)
ans =
9 8 7
ans =
Columns 1 through 3
0 0.2000 0.4000
Columns 4 through 6
ans =
Columns 1 through 3
Column 4
100.0000