Display string line by line

1 visualización (últimos 30 días)
Elysi Cochin
Elysi Cochin el 3 de Jun. de 2022
Respondida: Star Strider el 3 de Jun. de 2022
str = {'cats', 'dogs', 'birds'};
how to display the above string in command window as
cats
dogs
birds

Respuesta aceptada

Star Strider
Star Strider el 3 de Jun. de 2022
Use fprintf
str = {'cats', 'dogs', 'birds'};
fprintf('%s\n',str{:})
cats dogs birds
.

Más respuestas (0)

Categorías

Más información sobre String Parsing 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