is it possible to create array of strings or char from struct of cell arrays
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
SBird
el 20 de Abr. de 2021
Apologies if I get some of the terminology wrong. I have a struct which is an array, with some cell values. So:
A(1).name='one', A(1).val=1, A(2).name='two', A(2).val=2.
What I'd like to do is create an array of strings from just the names. So, I'd like B=['one','two'].
if I do B=A(:).name I get B='onetwo'.
All help appreciated!
1 comentario
Respuesta aceptada
per isakson
el 21 de Abr. de 2021
Editada: per isakson
el 21 de Abr. de 2021
A(1).name='one'; A(1).val=1; A(2).name='two'; A(2).val=2;
{A.name}
[A.name]
and there are string arrays
A(1).name="one"; A(1).val=1; A(2).name="two"; A(2).val=2;
[A.name]
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Characters and Strings 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!