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!