Filter löschen
Filter löschen

Display string line by line

3 Ansichten (letzte 30 Tage)
Elysi Cochin
Elysi Cochin am 3 Jun. 2022
Beantwortet: Star Strider am 3 Jun. 2022
str = {'cats', 'dogs', 'birds'};
how to display the above string in command window as
cats
dogs
birds

Akzeptierte Antwort

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

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by