Hi everybrody I have one column of text data (B) and one column of numerical data (A). I have to merge the two array in a unique dataset made of two columns (C). How can I do it?
simplified example: A=[0,1 0,2 0,3] B=[AT DE FR] C=[AT 0,1 DE 0,2 FR 0,3]
Thank you Giovanni

댓글 수: 1

the cyclist
the cyclist 2012년 6월 14일
This question would be clearer if you could use valid MATLAB syntax to indicate what A, B, and C look like.

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

답변 (1개)

Voss
Voss 2023년 6월 24일

0 개 추천

Here's a guess
% "one column of numerical data":
A = {[0 1]; [0 2]; [0 3]}
A = 3×1 cell array
{[0 1]} {[0 2]} {[0 3]}
% "one column of text data":
B = {'AT'; 'DE'; 'FR'}
B = 3×1 cell array
{'AT'} {'DE'} {'FR'}
% merge to two columns:
C = [B A]
C = 3×2 cell array
{'AT'} {[0 1]} {'DE'} {[0 2]} {'FR'} {[0 3]}

카테고리

도움말 센터File Exchange에서 Cell Arrays에 대해 자세히 알아보기

질문:

2012년 6월 14일

댓글:

2023년 8월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by