Info

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

mat2cell operation coordinates cell

3 次查看(过去 30 天)
Internazionale
Internazionale 2013-3-8
关闭: MATLAB Answer Bot 2021-8-20
i have a program from my question in 14 feb 2013, answered by Azzi Abdelmalek.
A=rand(4,4,4,4)
[ii1,ii2,ii3,ii4]=size(A)
count=0
id=zeros(ii3*ii4,4);
for k=1:ii3
for p=1:ii4
count=count+1;
v=A(:,:,k,p);
[val,idx]=min(v(:));
[id1,id2]=ind2sub(size(v),idx);
minval(count)=val;
idx1(count)=id1;
idx2(count)=id2;
idx3(count)=k;
idx4(count)=p;
id(count,:)=[id1 id2 k p] % correspondant indices
end
end
id is matrix that contains the information of coordinates that have the minimum value. my question, how to make there will be no same blocks that have minimum value ? because there's 2 different blocks have same blocks that have minimum value. how to prevent this condition ? i mean for, i dont want the 2 of same of id1, id2 have minimum value of one k,p. one id1,id2 just for k,p.

回答(0 个)

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by