필터 지우기
필터 지우기

Adding a column in particular location

조회 수: 17 (최근 30일)
Neesha
Neesha 2013년 12월 16일
댓글: Neesha 2013년 12월 16일
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?

채택된 답변

Walter Roberson
Walter Roberson 2013년 12월 16일
[A(:,1:2), B(:), A(:,3:end)]
  댓글 수: 3
Walter Roberson
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.
Neesha
Neesha 2013년 12월 16일
Ok, great, thanks

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by