The best way to get started with MATLAB is to learn how to handle matrices。
- 输出格式:
>> x = [4/3 1.2345e-7]
x =
1.3333 0.0000
>> format short
>> x = [4/3 1.2345e-7]
x =
1.3333 0.0000
>> format short e
>> x = [4/3 1.2345e-7]
x =
1.3333e+00 1.2345e-07
>>
- 删除矩阵的某一列
>> A
A =
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
>> A(:, 2) = []
A =
16 3 13
5 10 8
9 6 12
4 15 1
>>
- Logic Function
>> A(~isprime(A))
ans =
16
9
4
10
6
15
8
12
1
>>