is anyone know, how to know the matrix coordinate..?
9 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Wayne King
2013 年 12 月 1 日
編集済み: Wayne King
2013 年 12 月 1 日
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 件のコメント
その他の回答 (2 件)
Azzi Abdelmalek
2013 年 12 月 1 日
In your case, you have only 1 and 0
a = [1 1 0; 0 0 0; 0 0 1;];
[ii,jj]=find(a)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Resizing and Reshaping Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!