MATLAB: Write multiple line of text into a text file

save textwrite text

Simple question; I have this variable which I want easily write to a text file (it can be a hundred of lines, I just cut it into 4 to fit here)
app.DCMtxt.Value
ans =
4×1 cell array
'3 Message(s) transmitted '
''
' ws BUS ID Rx Node DLC Cycle Extended'
' ______ ___ ____ __ ____ ___ _____ ________'

Best Answer

fid = fopen('output.txt','w');
fprintf(fid, '%s\n',app.DCMtxt.Value{:}) ;
fclose(fid) ;
Related Question