proper orientation & writing to text file
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Walter Roberson
2012 年 11 月 23 日
sample1 = {'Software','UserName','Author'}; %NOT square brackets!
fprintf('%14s %-14s %14s\n', sample1{:});
4 件のコメント
Jan
2012 年 11 月 27 日
@Walter: It seems like your comments have lost their context. Did somebody delete some other comments? If so, who and why?
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!