Info

此问题已关闭。 请重新打开它进行编辑或回答。

error using 256x256matrix

1 次查看(过去 30 天)
FIR
FIR 2012-2-10
关闭: MATLAB Answer Bot 2021-8-20
A=[2 4 5 3
6 8 9 2
5 1 3 4 ];
A_1_10 = A(:,:,ones(10,1));
k = nchoosek(1:9,3);
k2 = k(all(diff(k,1,2)>1,2),:)
k3 = k2(1:floor(size(k2,1)/10):end,:)
A_1_10(bsxfun(@plus,k3(1:10,:),(0:9:9^2).')) = 0
i get answer for this
nut for 256x256 i am not getting the answer in which some values must be replaced by zero

回答(1 个)

Andrei Bobrov
Andrei Bobrov 2012-2-14
A=[2 4 5 3
6 8 9 2
5 1 3 4 ];
n = numel(A);
m = 10;
t = 4;
A_1_10 = A(:,:,ones(m,1));
k = nchoosek(1:n,t);
k2 = k(all(diff(k,1,2)>1,2),:)
k3 = k2(1:floor(size(k2,1)/m):end,:)
A_1_10(bsxfun(@plus,k3(1:m,:),(0:n:n*(m-1)).')) = 0
  3 个评论
FIR
FIR 2012-2-14
Andrei my system returns out of memory wen i give t=60,

此问题已关闭。

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by