Merge a row to a single cell

1 view (last 30 days)
kimia mote
kimia mote on 20 Jul 2021
Commented: kimia mote 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
kimia mote
kimia mote on 20 Jul 2021
Sorry I thought it was obvious

Sign in to comment.

Accepted Answer

Stephen
Stephen 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'}
  1 Comment
kimia mote
kimia mote on 20 Jul 2021
Thanks a lot. It works properly.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!