proper orientation & writing to text file
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
i have a string like
sample1 = ['Software','UserName','Author'];
sample2 = ['Matlab','john','Author1'];
sample3 = ['c','wright','Author2'];
now i need to write to txt file in below format
sample output format
Software UserName Author
Matlab john Author1
c wright Author2
problem is not able to adjust whitespaces
0 comentarios
Respuesta aceptada
Walter Roberson
el 23 de Nov. de 2012
sample1 = {'Software','UserName','Author'}; %NOT square brackets!
fprintf('%14s %-14s %14s\n', sample1{:});
4 comentarios
Jan
el 27 de Nov. de 2012
@Walter: It seems like your comments have lost their context. Did somebody delete some other comments? If so, who and why?
Más respuestas (0)
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!