How to delete specific rows in a matrix?
2 views (last 30 days)
Show older comments
Elaheh on 6 May 2018
Answered: Walter Roberson on 6 May 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.
Walter Roberson on 6 May 2018
NewMatrix = YourMatrix(YourMatrix(:,1)~=0, :);
More Answers (0)
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!