Matlab¶
- eye()标准矩阵
- randn() 高斯分布
- hist ()直方图
- sizea,1 row
- sizea,2 colum
- lengthvector
- clear A
- A1,10
- save hello.mat A
- save hello.txt A -ascii
- A:,2
- A: 全部元素变成向量
- C = [A B]
- C = [A; B]
Computation¶
- A.*B 对应元素相乘
- A.^2
- log
- exp
- abs
- a‘ 转置
- [val, index] = maxA
- a<3
- finda<3
- magic3
- sumA, 1 输出1xn
- proda
- floora 取整,取下限
- ceila 取整,取上限
- maxrand\(3, rand3)
- maxA, \[ \], 1 = maxA
- flipudeye\(9) 左右翻转
- pinvA 矩阵求逆
Plotting Data¶
- plotx, y, 'r'
- hold on
- xlabel'xlabel'
- ylabel'ylabel'
- legend'sin','cos'
- title'my plot'
- print -dpng 'myplot.png'
- figure1
- subplot1,2,1
- axis\[0.5 1 -1 1\]
- clf
- imagescA, colorbar, colormap grey
Control Statement¶
- indecis = 1:10
Vectorization¶
评论
作者: