Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
how do i filter from existing matrix and form separate matrix as follows?
조회 수: 1 (최근 30일)
이전 댓글 표시
example--------------- 1 2 3 4 4 3 5 4 3 2 1 2 2 3 4 4 5 5
I WANT SEPARATE MATRIX FOR 1 , 2 , 3, 4, 5 AS FOLLOWS? i.e i want to extract cell location of all 1's into separate matrix and all 2's into separate matrix and so on?? FOR 1 1 1 2 5 FOR 2 1 2 2 4 2 6 3 1
댓글 수: 1
답변 (1개)
Azzi Abdelmalek
2013년 6월 19일
편집: Azzi Abdelmalek
2013년 6월 19일
x=[1 2 3 4 4 3
5 4 3 2 1 2
2 3 4 4 5 5];
a=unique(x);
for k=1:numel(a)
[ii,jj]=find(x==a(k));
out{k}=[ii jj];
end
out{1}
out{2}
out{3}
%...
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!