Display string line by line

str = {'cats', 'dogs', 'birds'};
how to display the above string in command window as
cats
dogs
birds

 Risposta accettata

Use fprintf
str = {'cats', 'dogs', 'birds'};
fprintf('%s\n',str{:})
cats dogs birds
.

Più risposte (0)

Categorie

Community Treasure Hunt

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

Start Hunting!

Translated by