Adding a column in particular location
조회 수: 17 (최근 30일)
이전 댓글 표시
HI,
I have a metrics and I want to add a column with Title and values. I can create that column and do horzcat but that can add a column first or last. I want to add as a 3rd column. How do i do it?
댓글 수: 0
채택된 답변
Walter Roberson
2013년 12월 16일
[A(:,1:2), B(:), A(:,3:end)]
댓글 수: 3
Walter Roberson
2013년 12월 16일
Possibly if you use a "table" you could do that.
Otherwise, you could use ismember() of each column title you wish to refer to, comparing to the cell array of strings of column titles. With the two-output version if ismember() that would give you the numeric column indices that you could then re-arrange.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Cell Arrays에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!