Find , Skip Rows and Columns
古いコメントを表示
I just started learning Matlab. Need to Find element in Matrix M but skip columns (cy1 cy2 cy3). [r,c]=find(M==1);
回答 (1 件)
Guillaume
2015 年 1 月 22 日
There are many ways to do this, you could just remove the unwanted columns from the matrix:
M(:, [cy1, cy2, cy3]) = [];
[r,c] = find(M == 1);
Or you could tell find you want all columns but the unwanted ones, using setdiff:
[r,c] = find(M(:, setdiff(1:size(m, 2), [cy1, cy2, cy3])) == 1);
カテゴリ
ヘルプ センター および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!