Deleting Rows in a Table as Determined by a Variable Value

1 visualización (últimos 30 días)
Jake Bowd
Jake Bowd el 15 de Jul. de 2020
Comentada: Jake Bowd el 16 de Jul. de 2020
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,

Respuesta aceptada

madhan ravi
madhan ravi el 15 de Jul. de 2020
TabLE(119:end, :) = []
  3 comentarios
madhan ravi
madhan ravi el 15 de Jul. de 2020
From = 119;
TabLE(From:end, :) = []
Jake Bowd
Jake Bowd el 16 de Jul. de 2020
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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by