How to delete variables in a table within a cell array

조회 수: 3 (최근 30일)
Isabelle Museck
Isabelle Museck 2024년 6월 3일
답변: Torsten 2024년 6월 3일
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.

채택된 답변

Voss
Voss 2024년 6월 3일
Here's one way:
C = cellfun(@(t)removevars(t,[1 2]),C,'UniformOutput',false);

추가 답변 (1개)

Torsten
Torsten 2024년 6월 3일
for i=1:10
c{i}(:,1:2) = [];
end

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by