How to delete every nth column in table?
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a table (X) and want to delete every 2nd column from it.
0 Kommentare
Antworten (1)
Mathieu NOE
am 11 Mär. 2024
Bearbeitet: Mathieu NOE
am 11 Mär. 2024
maybe this ?
X = (1:9)'*(1:10:50);
% remove only 2nd column
t = array2table(X,'VariableNames',{'t' 'x' 'y' 'z' 'r'})
t(:,2) = []
% remove every 2nd column (c = 2,4,6,...)
t = array2table(X,'VariableNames',{'t' 'x' 'y' 'z' 'r'});
t(:,2:2:end) = []
0 Kommentare
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!