码迷,mamicode.com
首页 > 其他好文 > 详细

矩阵操作

时间:2016-08-28 19:33:03      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:

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度

 

矩阵操作

标签:

原文地址:http://www.cnblogs.com/jiangkejie/p/5815655.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!