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);

Antworten (1)

Guillaume
Guillaume am 22 Jan. 2015

1 Stimme

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);

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

mW
am 22 Jan. 2015

Beantwortet:

am 22 Jan. 2015

Community Treasure Hunt

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

Start Hunting!

Translated by