1 colormap(gray): 设置图像为灰度图像
2 exist(NAME,TYPE); NAME放置需要检测的变量,TYPE可以设置:'var','builtin','file','dir'
3 size(X) 返回数组X的 行、列数目;size(X,1) 返回数组X的行数目; size(X,2)返回数组的列数目。
4 bsxfun(@function,A,B): 根据function的不同对矩阵A和B 进行运算:
在运算过程中,如果矩阵A\B的维数不一致,根据具体情况将进行扩充。一般扩充的情况是A、B中某一个维度是1,那么就会完全复制另外一个维度的内容来扩充这一维度。但是最后扩充的维度一定不会超过另外一个矩阵相对应的维度的数值。举例:A为3*1的矩阵,B是3*3的矩阵.那么A就会扩充为3*3,其中每一列的元素都相同,再与B的每一个对应元素进行具体运算。
运算有如下几种:
@plus | Plus |
@minus | Minus |
@times | Array multiply |
@rdivide | Right array divide |
@ldivide | Left array divide |
@power | Array power |
@max | Binary maximum |
@min | Binary minimum |
@rem | Remainder after division |
@mod | Modulus after division |
@atan2 | Four quadrant inverse tangent |
@hypot | Square root of sum of squares |
@eq | Equal |
@ne | Not equal |
@lt | Less than |
@le | Less than or equal to |
@gt | Greater than |
@ge | Greater than or equal to |
@and | Element-wise logical AND |
@or | Element-wise logical OR |
@xor | Logical exclusive OR |