How does logical indexing work?
古いコメントを表示
採用された回答
その他の回答 (1 件)
Anish
2011 年 1 月 18 日
Assume A is a MxN matrix.
Let "tf" be a MxN logical matrix.
Then A(tf) extracts all elements of A corresponding to all true elements in tf
A = rand(5); % Random 5x5 matrix
tf = A > .5 % Logical matrix of same size 5x5
A(tf) % All values in A greater than .5 as a column
For more help, see Steve's excellent blog in this:
Or good old MATLAB doc:
コミュニティ
その他の回答 パワー エレクトロニクス コミュニティ
カテゴリ
ヘルプ センター および File Exchange で Matrix Indexing についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!