Merge a row to a single cell

1 view (last 30 days)
Sahar khalili
Sahar khalili on 20 Jul 2021
Commented: Sahar khalili on 20 Jul 2021
Hi,
I have a cell like this:
A=['1' '2' ':' '5' '7' ':' '0' '0'
'1' '2' ':' '5' '7' ':' '0' '0'
'1' '2' ':' '5' '7' ':' '0' '0'
'1' '2' ':' '5' '7' ':' '0' '0'];
and I want to merge every row to a single one to get this:
[ 12:57:00
12:57:00
12:57:00
12:57:00 ]
Does anyone know how can i do so?
  4 Comments
Scott MacKenzie
Scott MacKenzie on 20 Jul 2021
That looks like a spreadsheet, not a cell array in MATLAB. Please clarify what your question is.
Sahar khalili
Sahar khalili on 20 Jul 2021
Sorry I thought it was obvious

Sign in to comment.

Accepted Answer

Stephen23
Stephen23 on 20 Jul 2021
C = {...
'1' '2' ':' '5' '7' ':' '0' '0'
'1' '2' ':' '5' '7' ':' '0' '0'
'1' '2' ':' '5' '7' ':' '0' '0'
'1' '2' ':' '5' '7' ':' '0' '0'};
D = join(C,'',2)
D = 4×1 cell array
{'12:57:00'} {'12:57:00'} {'12:57:00'} {'12:57:00'}

More Answers (0)

Categories

Find more on Multidimensional Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!