How to delete specific rows in a matrix?

1 Ansicht (letzte 30 Tage)
Elaheh
Elaheh am 6 Mai 2018
Hello all, I have a matrix including two columns and some rows. I have numbers and zeros in the first column and numbers and empty slots in the second column.How can I delete zeros in the first column and their corresponding empty slots in the second column? Thank you in advance.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 6 Mai 2018
NewMatrix = YourMatrix(YourMatrix(:,1)~=0, :);

Weitere Antworten (0)

Kategorien

Mehr zu Numeric Types 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!

Translated by