How can I split a long string of text into multiple lines in Matlab ? For example,
fprintf(fileID,'%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n',..
I want to to split the
%s
so I can comment what each item means but I still want them to be in the same line in the output. But the ... do not work within strings.
fprintf(fileID,'%s,... % ID
%s,... % frame
%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n',..

 채택된 답변

KSSV
KSSV 2018년 12월 12일

1 개 추천

Use fprintf for each line seperatly suing \n at the end.

추가 답변 (1개)

Guillaume
Guillaume 2018년 12월 12일

1 개 추천

fprintf(fileID, ['%s,' ... ID
'%s,' ... frame
'%s,' ...
'%s\n'], ...
...
);

카테고리

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

태그

질문:

2018년 12월 12일

답변:

2018년 12월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by