Question using fprintf for words
2 次查看(过去 30 天)
显示 更早的评论
I know how to use fprintf for a string of numbers but I was wondering if there is way to assign it to variable or words such as
A= ['jan','feb','march','april']
fprintf('% \n',A)
to get output
jan
feb
march
april
0 个评论
采纳的回答
Azzi Abdelmalek
2014-11-20
编辑:Azzi Abdelmalek
2014-11-20
A= {'jan','feb','march','april'};
fprintf('%s \n',A{:})
0 个评论
更多回答(1 个)
Chad Greene
2014-11-20
Curly brackets and disp would be a different way:
A= {'jan','feb','march','april'}
disp(A)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Entering Commands 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!