>> %operation
>> a=[1 2;3 4 ;5 6]
a =
>> a=[1 2;3 4 ;5 6]
a =
1 2
3 4
5 6
3 4
5 6
>> b =[11 12; 13 14; 15 16]
b =
b =
11 12
13 14
15 16
13 14
15 16
>> c = a*b
error: operator *: nonconformant arguments (op1 is 3x2, op2 is 3x2)
>> c = a*b'
c =
error: operator *: nonconformant arguments (op1 is 3x2, op2 is 3x2)
>> c = a*b'
c =
35 41 47
81 95 109
127 149 171
81 95 109
127 149 171
>> %'meas the transpose
>> d = a.*b
d =
>> d = a.*b
d =
11 24
39 56
75 96
39 56
75 96
>> %.meas the operation of the element
>> A.^2
error: 'A' undefined near line 2 column 1
>> a.^2
ans =
>> A.^2
error: 'A' undefined near line 2 column 1
>> a.^2
ans =
1 4
9 16
25 36
9 16
25 36
>> v=1:3
v =
v =
1 2 3
>> log(v)
ans =
ans =
0.00000 0.69315 1.09861
>> %log means count the lorarithm
>> exp(v)
ans =
>> exp(v)
ans =
2.7183 7.3891 20.0855
>> v = -8:3
v =
v =
-8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3
>> abs(v)
ans =
ans =
8 7 6 5 4 3 2 1 0 1 2 3
>> v=v+1
v =
v =
-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4
>> v'
ans =
ans =
-7
-6
-5
-4
-3
-2
-1
0
1
2
3
4
-6
-5
-4
-3
-2
-1
0
1
2
3
4
>> max(abs(v))
ans = 7
>> v>0
ans =
ans = 7
>> v>0
ans =
0 0 0 0 0 0 0 0 1 1 1 1
>> find(v>1)
ans =
ans =
10 11 12
>> v
v =
v =
-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4
>> find(v>0)
ans =
ans =
9 10 11 12
>> b = magic(3)
b =
b =
8 1 6
3 5 7
4 9 2
3 5 7
4 9 2
>> [r,c]=find(b>7)
r =
r =
1
3
3
c =
1
2
2
>> sumb(
end
break;
parse error:
parse error:
syntax error
>>> break;
^
^
>> sum(b)
ans =
ans =
15 15 15
>> max(b,[],2)
ans =
ans =
8
7
9
7
9
>> max(b,[],1)
ans =
ans =
8 9 7
>> max(max(b))
ans = 9
>> max(b(:))
ans = 9
>> sum(b,1)
ans =
ans = 9
>> max(b(:))
ans = 9
>> sum(b,1)
ans =
15 15 15
>> sum(b,2)
ans =
ans =
15
15
15
15
15
>> %1 biao shi dui hang de ji suan ,2biao shi dui lie de ji suan
>> pinv(b)
ans =
>> pinv(b)
ans =
0.147222 -0.144444 0.063889
-0.061111 0.022222 0.105556
-0.019444 0.188889 -0.102778
-0.061111 0.022222 0.105556
-0.019444 0.188889 -0.102778
>> c = ans
c =
c =
0.147222 -0.144444 0.063889
-0.061111 0.022222 0.105556
-0.019444 0.188889 -0.102778
-0.061111 0.022222 0.105556
-0.019444 0.188889 -0.102778
>> c*b
ans =
ans =
1.0000e+000 2.0817e-016 -3.1641e-015
-6.1062e-015 1.0000e+000 6.2450e-015
3.0531e-015 4.1633e-017 1.0000e+000
-6.1062e-015 1.0000e+000 6.2450e-015
3.0531e-015 4.1633e-017 1.0000e+000
>>