Concatenate String and Numbers Horizontally
조회 수: 2 (최근 30일)
이전 댓글 표시
I have 3 columns of data: 1 string and 2 number
a = [ 'A';'B';'C'] b = [75; 85; 95] c = [89; 95; 58]
I am trying to horizontally concatenate a,b,c into one array of d. As seen below:
'A' 75 89
'B' 85 95
'C' 95 58
Some reason it is the combination of stings and numbers that is causing the problem.
Thanks, Amanda
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2013년 2월 19일
편집: Azzi Abdelmalek
2013년 2월 19일
You should use a cell array
out=[cellstr(a) num2cell(b) num2cell(c)]
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!