MATLAB Answers

Creating new matrix with another matrix

6 views (last 30 days)
TUGRUL KURNAZ
TUGRUL KURNAZ on 20 Nov 2019
Answered: Rik on 20 Nov 2019
We have a matrix,if any of the rows has a 0 at the last column we take the that row to write a new matrix and it will continue till the end of the old matrix.

  0 Comments

Sign in to comment.

Answers (1)

Rik
Rik on 20 Nov 2019
Do you mean something like this?
data=randi([-2 5],[50 70]);
hasZeroInLastCol= data(:,end)==0;
newdata=data(hasZeroInLastCol,:);

  0 Comments

Sign in to comment.

Sign in to answer this question.