矩阵操作

reshape(a, m, n)

a是一个含有m*n个元素的数组

如reshape(1:9, 3, 3)

 

findstr(str1, str2)

在str2中查找str1片段

b = [0111001000100110111];

a = length(findstr(01,  b)

 

矩阵的翻转

flipud()   

flip a matrix up to down.上下

a = reshape(1:9, 3 , 3)

>>a=[ 1 2 3      

4 5 6

7 8 9]

>>flipup(a)

7 8 9

4 5 6

1 2 3

fliplr

flip a matrix left to right

fliplr(a)

>>3 2 1

6 5 4

9 8 7

 

rot90(a)

旋转90度

 

posted on 2016-08-28 18:57  那抹阳光1994  阅读(160)  评论(0)    收藏  举报

导航