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,

 Réponse acceptée

TabLE(119:end, :) = []

3 commentaires

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?
From = 119;
TabLE(From:end, :) = []
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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Centre d'aide et File Exchange

Produits

Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by