【发布时间】:2015-09-26 03:29:40
【问题描述】:
我在其他代码中看到了这一点,无法理解这是什么意思 x=x(: , N) 其中 x 是二维数组,N 是一维数组
这里有一些例子
test = [1,2;3,4];
ttt = [1,1,1,1 ,2,2,2,2];
test = test(:,ttt);
结果是:
1 1 1 1 2 2 2 2
3 3 3 3 4 4 4 4
和
test = [1,2;3,4];
ttt = [1,1,1,1 ,1,1,1,1];
test = test(:,ttt);
结果是:
1 1 1 1 1 1 1 1
3 3 3 3 3 3 3 3
谢谢!
【问题讨论】:
-
vincentcheung.ca/research/matlabindexrepmat.html这里说的和repmat功能一样。
标签: arrays matlab matrix multidimensional-array