Hey
I want to merge a cell array with a vector. In the cell array I have text and the vector contains numbers. So what I want is to merge them like this:
Q = (Blabla1, blabla2, blabla3, ...)
T = (1.52, 1.78, 1.67 ...)
QT ="row 1" Blabla1, blabla2, blabla3, ...
"row 2" 1.52, 1.78, 1.67 ...
Thanks in advance!

 채택된 답변

Matt J
Matt J 2014년 5월 5일
편집: Matt J 2014년 5월 5일

0 개 추천

This might be an example of what you want,
>> Q={'dog', 'cat'};
T=[1,2];
>> QT=[Q;num2cell(T)]
QT =
'dog' 'cat'
[ 1] [ 2]

댓글 수: 1

Kasper
Kasper 2014년 5월 5일
QT=[Q;num2cell(T)] did the trick ! My Q and T was already filled with data, so QT=[Q;num2cell(T)] was all I needed. Thank you!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기

질문:

2014년 5월 5일

댓글:

2014년 5월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by