How to delete every nth column in table?
7 ビュー (過去 30 日間)
古いコメントを表示
I have a table (X) and want to delete every 2nd column from it.
0 件のコメント
回答 (1 件)
Mathieu NOE
2024 年 3 月 11 日
編集済み: Mathieu NOE
2024 年 3 月 11 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Tables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!