How to delete every nth column in table?
조회 수: 8 (최근 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!