Question using fprintf for words
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
benny
le 20 Nov 2014
Modifié(e) : Image Analyst
le 21 Nov 2014
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 commentaires
Réponse acceptée
Azzi Abdelmalek
le 20 Nov 2014
Modifié(e) : Azzi Abdelmalek
le 20 Nov 2014
A= {'jan','feb','march','april'};
fprintf('%s \n',A{:})
0 commentaires
Plus de réponses (1)
Chad Greene
le 20 Nov 2014
Curly brackets and disp would be a different way:
A= {'jan','feb','march','april'}
disp(A)
0 commentaires
Voir également
Catégories
En savoir plus sur Entering Commands 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!