appending a column to a cell array

조회 수: 122 (최근 30일)
gmltn1212
gmltn1212 2020년 7월 4일
답변: Voss 2020년 7월 4일
Hi I am trying to append a column to an existing cell array also with an additional header...
addthis = {1;2;3;4;5}
addheader = 'third col'
tothis = {'first col' 'second col'; 0, 0; 0, 0; 0, 0; 0, 0; 0, 0}
I want to return this
added = {'first col' 'second col' 'third col'; 0, 0, 1; 0, 0, 2; 0, 0, 3; 0, 0, 4; 0, 0, 5}

답변 (1개)

Voss
Voss 2020년 7월 4일
added = [tothis [addheader; addthis]];

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by