Display string line by line

1 次查看(过去 30 天)
str = {'cats', 'dogs', 'birds'};
how to display the above string in command window as
cats
dogs
birds

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 String Parsing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by