加减乘除优先级:
- ^(幂) > *, / > + -
练习:
MATLAB Calling Priority
Numeric Display Format
1 | >> format short |
Command Line Terminal
方向键向上(PgUp)可以展示上一条指令
clc: clear command window display
clear: remove all variables in the workspace
who: variables in the workspace
whos: variable information of the workspace
Array(Vector and Matrix)
- Row vector:
a = [1 2 3 4]
- Column vector:
b = [1;2;3;4]
1 | >> a = [1 2 3 4] |
Array Indexing
1 | >> A = [1 21 6; 5 17 9; 31 2 7] |
Colon operator
1 | >> B = 1 : 5 |
1 | >> A = [1 21 6; 5 17 9; 31 2 7] |
Array Concatenation
1 | >> A = [1 2; 3 4] |
Array Manipulation
1 | >> A = [1:3; 4 5 4; 9 8 7] |
Some Special Matrix
1 | >> linspace(0, 13, 6) |
Some Matrix Related Function
1 | >> A = [1 2 3 ; 0 5 6; 7 0 9] |