필터 지우기
필터 지우기

Delete rows in a matrix based on their first number in the row.

조회 수: 1 (최근 30일)
Patrick Guarente
Patrick Guarente 2017년 9월 1일
편집: the cyclist 2017년 9월 2일
I have two matrices.
Del= [12 3 5; 15 2 7; 20 4 9; 10 2 1]
Close= [15 ; 10; 20]
I need to get rid of the Del rows that start with the values in Close. In this situation I would need to get ride of rows 2, 3, 4
Thank you

답변 (1개)

the cyclist
the cyclist 2017년 9월 1일
Del(ismember(Del(:,1),Close),:) = [];
  댓글 수: 2
the cyclist
the cyclist 2017년 9월 2일
편집: the cyclist 2017년 9월 2일
The best form of thanks is to vote for and/or accept answers that are helpful. This rewards the contributor, and points future users to useful answers.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Sparse Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by