Borrar filtros
Borrar filtros

Matlab write string on new line

5 visualizaciones (últimos 30 días)
Haziq Razali
Haziq Razali el 12 de Dic. de 2018
Respondida: Guillaume el 12 de Dic. de 2018
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',..

Respuesta aceptada

KSSV
KSSV el 12 de Dic. de 2018
Use fprintf for each line seperatly suing \n at the end.

Más respuestas (1)

Guillaume
Guillaume el 12 de Dic. de 2018
fprintf(fileID, ['%s,' ... ID
'%s,' ... frame
'%s,' ...
'%s\n'], ...
...
);

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by