Change cell object to char
Mostrar comentarios más antiguos
How can I convert the name object to be a char instead of a cell?
Thank you very much.
Emily
Respuestas (1)
a={'abc'}
whos a
b=char(a)
whos b
4 comentarios
Emily Doherty
el 3 de Nov. de 2022
Joseph Mah
el 3 de Nov. de 2022
You could just set a=char(a) if your goal is to make a char instead of a cell array, though will not work if you have multiple cells in your cell array. In that case maybe look into string arrays.
Emily Doherty
el 3 de Nov. de 2022
Fangjun Jiang
el 3 de Nov. de 2022
Might it be that this field 'name' in that nested structure requires a cell of string?
try
SubjStats(1, 1).basis.stim.values{1, 1}.name='abc'
Categorías
Más información sobre Data Type Conversion en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!