Borrar filtros
Borrar filtros

Problem in convert cell to string.

1 visualización (últimos 30 días)
Ara
Ara el 7 de En. de 2015
Comentada: Ara el 7 de En. de 2015
I have a cell show like this
% code
val =
title="
google
">
The value is 3*7 char. If I want to convert into string to be ---> title="google"> What can I do? I have found many solution but can't help for this one. Thank you.

Respuesta aceptada

Guillaume
Guillaume el 7 de En. de 2015
Possibly, this is what you want:
strjoin(cellstr(val), '')
  5 comentarios
Guillaume
Guillaume el 7 de En. de 2015
In that case, my code works:
>> val = ['title="'
'google '
'"> '];
>> whos val
Name Size Bytes Class Attributes
val 3x7 42 char
>> strjoin(cellstr(val), '')
ans =
title="google">
Ara
Ara el 7 de En. de 2015
Thank you. It's work

Iniciar sesión para comentar.

Más respuestas (1)

Sean de Wolski
Sean de Wolski el 7 de En. de 2015
S = reshape(A',1,[])
No reason to convert to and from a cell.
  3 comentarios
Sean de Wolski
Sean de Wolski el 7 de En. de 2015
Editada: Sean de Wolski el 7 de En. de 2015
Ahh, I didn't realize cellstr implicitly calls deblank. Good to know!
Ara
Ara el 7 de En. de 2015
Thank you very much.

Iniciar sesión para comentar.

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by