Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

how do i filter from existing matrix and form separate matrix as follows?

1 Ansicht (letzte 30 Tage)
sushant
sushant am 19 Jun. 2013
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
ETC ETC ETC FOR 3, 4, 5 also how do i do it? plz help its urgent ksushantk@gmail.com

Antworten (1)

Azzi Abdelmalek
Azzi Abdelmalek am 19 Jun. 2013
Bearbeitet: Azzi Abdelmalek am 19 Jun. 2013
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}
%...

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by