摘要: K>> a = 10*ones(1,10);K>> b = [1 56 23 5 6 45 9 7 89 10];K>> c = b> a(c) = b(c)a = 1 10 10 5 6 10 9 7 10 10 从试验可以看... 阅读全文
posted @ 2015-07-14 18:39 加拿大小哥哥 阅读(1614) 评论(0) 推荐(0) 编辑
摘要: 怎样用mat2cell将一个100*100的矩阵分成10个10*100的矩阵? 根据帮助中 c = mat2cell(x,m,n)应该这样写 mat2cell(x,[10 10 10 10 10 10 10 10 10 10],[100]) 能不能有简便的办法? 假... 阅读全文
posted @ 2015-07-14 17:48 加拿大小哥哥 阅读(21189) 评论(3) 推荐(1) 编辑
摘要: Compute the mean of each vector in cell array C.C = {1:10, [2; 4; 6], []};averages = cellfun(@mean, C)This code returnsaverages = 5.5000 4.0000 ... 阅读全文
posted @ 2015-07-14 17:27 加拿大小哥哥 阅读(48378) 评论(0) 推荐(1) 编辑