Convert several columns char matrix into one column char matrix

조회 수: 1 (최근 30일)
Cláudia Oliveira
Cláudia Oliveira 2020년 7월 3일
댓글: Cláudia Oliveira 2020년 7월 6일
I have a 200x12 matrix, with hours, minutes, seconds info. Each row has a time format like this: "13:35:43,050", but each column is composed of a single character of the time format ("1" in column 1; "3" in column 2; ":" in column 3, etc). I would like to end up with a 200x1 matrix, where all the column characters would appear in a single column, with no spaces. Can you help me, please? Thank you very much.
  댓글 수: 4
Cláudia Oliveira
Cláudia Oliveira 2020년 7월 4일
I expect to obtain on every row the same time format "13:35:43,050" but with all the characters together in a single column and not separated into 12 columns. Thank you very much.
Cláudia Oliveira
Cláudia Oliveira 2020년 7월 6일
Thank you very much everyone for your help.
Stephen Cobeldick's suggestion worked well. Thanks a million!

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

답변 (1개)

Sindar
Sindar 2020년 7월 4일
join?
>> tmp={'a' 'b' 'c' ; 'd' 'e' 'f'}
tmp = 2×3 cell
'a' 'b' 'c'
'd' 'e' 'f'
>> join(tmp,'')
ans = 2×1 cell
'abc'
'def'

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by