Question using fprintf for words
14 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
benny
il 20 Nov 2014
Modificato: Image Analyst
il 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 Commenti
Risposta accettata
Azzi Abdelmalek
il 20 Nov 2014
Modificato: Azzi Abdelmalek
il 20 Nov 2014
A= {'jan','feb','march','april'};
fprintf('%s \n',A{:})
0 Commenti
Più risposte (1)
Chad Greene
il 20 Nov 2014
Curly brackets and disp would be a different way:
A= {'jan','feb','march','april'}
disp(A)
0 Commenti
Vedere anche
Categorie
Scopri di più su Characters and Strings in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!