Merge a row to a single cell

2 visualizaciones (últimos 30 días)
Sahar khalili
Sahar khalili el 20 de Jul. de 2021
Comentada: Sahar khalili el 20 de Jul. de 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 comentarios
Scott MacKenzie
Scott MacKenzie el 20 de Jul. de 2021
That looks like a spreadsheet, not a cell array in MATLAB. Please clarify what your question is.
Sahar khalili
Sahar khalili el 20 de Jul. de 2021
Sorry I thought it was obvious

Iniciar sesión para comentar.

Respuesta aceptada

Stephen23
Stephen23 el 20 de Jul. de 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 comentario
Sahar khalili
Sahar khalili el 20 de Jul. de 2021
Thanks a lot. It works properly.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by