Adding a column in particular location

13 Ansichten (letzte 30 Tage)
Neesha
Neesha am 16 Dez. 2013
Kommentiert: Neesha am 16 Dez. 2013
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?

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 16 Dez. 2013
[A(:,1:2), B(:), A(:,3:end)]
  3 Kommentare
Walter Roberson
Walter Roberson am 16 Dez. 2013
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 am 16 Dez. 2013
Ok, great, thanks

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by