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