How do I write an array and a string to a text file?

Hi,
I have an array of numbers that I need to export to a text file, but I also need to add the sting '0 to the end of each number. I have tried using the fprintf command but can't get the formating correct.
For example, if the array was:
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
I need to have a text file that reads:
1'0 2'0 3'0 4'0 5'0
1'0 2'0 3'0 4'0 5'0
1'0 2'0 3'0 4'0 5'0
Thanks for your help!

 채택된 답변

Image Analyst
Image Analyst 2014년 6월 19일
편집: Image Analyst 2014년 6월 19일
Try this:
fprintf('%d''0, %d''0, %d''0, %d''0, %d''0\n', m');
where m is your matrix.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

질문:

2014년 6월 19일

댓글:

2014년 6월 19일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by