Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

mat2cell operation coordinates cell

2 views (last 30 days)
Internazionale
Internazionale on 8 Mar 2013
Closed: MATLAB Answer Bot on 20 Aug 2021
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.

Answers (0)

Community Treasure Hunt

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

Start Hunting!