Deleting Rows in a Table as Determined by a Variable Value

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 日

0 投票

TabLE(119:end, :) = []

3 件のコメント

Jake Bowd
Jake Bowd 2020 年 7 月 15 日
Thanks for the response.
Arhaa! I wish it was that easy (I should have said ...)
The input will not always be 119 - this value will change and so I wish to just call a variable in with said value.
Hope that’s easy to follow?
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 件)

カテゴリ

ヘルプ センター および File ExchangeMatrices and Arrays についてさらに検索

製品

リリース

R2020a

質問済み:

2020 年 7 月 15 日

コメント済み:

2020 年 7 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by