MATLAB: Regarding “fwrite” in matlab

delimiterfwrite

The following lines are a part of my code.
fid=fopen('M1.txt','w');
fwrite(fid,k,'int16');
fclose(fid);
I would like know how to include a delimiter. I need the .txt file to have 16 bits per line since this data has to be read line by line for further processing.
Kindly help me with this at the earliest.
Thank you

Best Answer

O.K., I give it another try:
x = 42;
fprintf(fid, '%s\n', dec2bin(x, 16));
Is that what you need?
Titus