Question using fprintf for words
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
benny
el 20 de Nov. de 2014
Editada: Image Analyst
el 21 de Nov. de 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 comentarios
Respuesta aceptada
Azzi Abdelmalek
el 20 de Nov. de 2014
Editada: Azzi Abdelmalek
el 20 de Nov. de 2014
A= {'jan','feb','march','april'};
fprintf('%s \n',A{:})
0 comentarios
Más respuestas (1)
Chad Greene
el 20 de Nov. de 2014
Curly brackets and disp would be a different way:
A= {'jan','feb','march','april'}
disp(A)
0 comentarios
Ver también
Categorías
Más información sobre Characters and Strings en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!