Borrar filtros
Borrar filtros

How to delete variables in a table within a cell array

6 visualizaciones (últimos 30 días)
Isabelle Museck
Isabelle Museck el 3 de Jun. de 2024
Respondida: Torsten el 3 de Jun. de 2024
Hello there I have a 10x1 cell array with each cell containing a 540x3 table of values. I am looking to delete the first two colums of each table in the cell array so that there is a 10x1 cell array with each cell contaning a 540x1 table with only the last column. Is there an easy wasy to do this? Thank you so much.

Respuesta aceptada

Voss
Voss el 3 de Jun. de 2024
Here's one way:
C = cellfun(@(t)removevars(t,[1 2]),C,'UniformOutput',false);

Más respuestas (1)

Torsten
Torsten el 3 de Jun. de 2024
for i=1:10
c{i}(:,1:2) = [];
end

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by