Display of data side by side
4 ビュー (過去 30 日間)
古いコメントを表示
raghavendra kandukuri
2018 年 8 月 21 日
コメント済み: raghavendra kandukuri
2018 年 8 月 22 日
Hi,
I have an output in txt file(notepad) which is displaying all in a single row, instead I want them side by side, following is the code I am using right now:
x1='TORQUE:';
dlmwrite('LTM.txt',x1,'delimiter','','-append','newline','pc');
dlmwrite('LTM.txt',Yout,'-append','newline','pc');
y1='ENGINE SPEED:';
dlmwrite('LTM.txt',y1,'delimiter','','-append','newline','pc');
dlmwrite('LTM.txt',temp2,'-append','newline','pc');
z1='DURATION:';
dlmwrite('LTM.txt',z1,'delimiter','','-append','newline','pc');
dlmwrite('LTM.txt',temp3,'-append','newline','pc');
dlmwrite('LTM.txt',Yout,'delimiter','\t');
Attached is the output file
0 件のコメント
採用された回答
Walter Roberson
2018 年 8 月 21 日
dlmwrite() adds the line terminator at the end of the last line that you write. When you -append on the next call, it appends to the end -- which is to say after that line terminator.
dlmwrite() cannot be used to append columns to an existing text file. Not even if you use the range inputs: the range input creates a zero-padded matrix and writes or appends that.
You will probably need to use fopen()/fprintf()/fclose() to get the file you want.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で String Parsing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!