Display string line by line

1 vue (au cours des 30 derniers jours)
Elysi Cochin
Elysi Cochin le 3 Juin 2022
str = {'cats', 'dogs', 'birds'};
how to display the above string in command window as
cats
dogs
birds

Réponse acceptée

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

Plus de réponses (0)

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by