is anyone know, how to know the matrix coordinate..?
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
is anyone know, how to know the matrix coordinate..?
a = [1 1 0; 0 0 0; 0 0 1;];
1 have coordinate on, (1,1) (1,2) and (3,3)
how to know the matrix coordinate..?
0 Kommentare
Akzeptierte Antwort
Wayne King
am 1 Dez. 2013
Bearbeitet: Wayne King
am 1 Dez. 2013
a = [1 1 0; 0 0 0; 0 0 1;];
idx = find(a==1); % linear coordinates
[I,J] = ind2sub(size(a),idx);
The I,J pairs are the "matrix coordinates"
0 Kommentare
Weitere Antworten (2)
Azzi Abdelmalek
am 1 Dez. 2013
In your case, you have only 1 and 0
a = [1 1 0; 0 0 0; 0 0 1;];
[ii,jj]=find(a)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!