필터 지우기
필터 지우기

how can i delete the extracted rows from the original matrix ?

조회 수: 1 (최근 30일)
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD 2017년 11월 22일
댓글: MAHMOUD ALZIOUD 2017년 11월 27일
Dear All, I have an original matrix called M that is 1000*15, I extracted a matrix from it based on a condition and is called Tand, Tand is 400*15, now how can i delete the extraced rows from the original matrix? i wrote this but it didnt work, because the size of M is still 1000*15 instead of 600*15 !! please help
Tand= M(M(:,15)<6, :); % this is the extracted one with 400*15 dimension.
M(Tand, :)= []; %this is to delete all the rows from M that belongs to Tand.
%where is the problem?

채택된 답변

James Tursa
James Tursa 2017년 11월 22일
x = M(:,15)<6; % Remember the logical indexes of the rows
Tand= M(x, :); % this is the extracted one with 400*15 dimension.
M(x, :)= []; %this is to delete all the rows from M that belongs to Tand.
  댓글 수: 4
James Tursa
James Tursa 2017년 11월 27일
Can you show a short code snippet of what you are trying to do with the files?
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD 2017년 11월 27일
Mr James I just solved it based on your advice, it was amazing because I forgot about the logic of the condition, thank you very much for your help.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by