Creating new matrix with another matrix

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.

답변 (1개)

Rik
Rik 2019년 11월 20일

0 개 추천

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

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

질문:

2019년 11월 20일

답변:

Rik
2019년 11월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by