Deleting Rows in a Table as Determined by a Variable Value

조회 수: 1 (최근 30일)
Jake Bowd
Jake Bowd 2020년 7월 15일
댓글: Jake Bowd 2020년 7월 16일
I have a 189x317 table and a variable with a value (lets says 119).
I want to delete all rows from 199 onwards.
Please could someone advise.
Best wishes,

채택된 답변

madhan ravi
madhan ravi 2020년 7월 15일
TabLE(119:end, :) = []
  댓글 수: 3
madhan ravi
madhan ravi 2020년 7월 15일
From = 119;
TabLE(From:end, :) = []
Jake Bowd
Jake Bowd 2020년 7월 16일
Madhan ravi,
Thank you so much! I think I was getting my brackets confused!!!
That worked perfectly!!! Thanks :).
I have now put the above into a for loop ;).
for i=1:size(TabLE,2)
From(i) = [Variable(1,i)];
TabLE{1, i}(From(1,i):end, :) = [];
end

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by