Loops matrix to find zero then cancel the rows relative and create a new matrix
Show older comments
Dear all, I try to prepare this file, anyone can help me? I want to loop a matrix A, looks that if in the 3rd row there is a zero, cancel the relative rows and store data in a new matrix. I give you an example in the picture... Thanks a lot

Accepted Answer
More Answers (1)
Kian Azami
on 27 Sep 2017
Edited: Kian Azami
on 27 Sep 2017
0 votes
Hello,
If A is a Matrix you can simply do it by the following command:
B = A(A(:,3) ~= 0,:)
if A is Table:
B = A{A{:,3} ~= 0,:}
Categories
Find more on Loops and Conditional Statements 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!