FAPPENDL

バージョン 1.0.0.0 (723 Bytes) 作成者: Mukhtar Ullah
FAPPENDL Write line to file in an intuitive syntax rather than FPRINTF
ダウンロード: 3.7K
更新 2008/2/19

ライセンスがありません

FAPPENDL(FID, ARG1, ARG2, ...) is the same as
FPRINTF(FID, '%s\n', [ARG1, ' ', ARG2, ' ', ...]) and hence provides an
intuitive syntax for writing lines to a file. When all you need is write
a single line to a file, the original syntax provided by FPRINTF becomes
quite cumbersome. The best way is illustrate by an example.

First write a file 'fname1.tex' using FPRINTF:

pgffile = 'drawing.pgf';
fid = fopen('fname1.tex', 'w');
fprintf(fid, '%s\n', '\documentclass{article}');
fprintf(fid, '%s\n', '\usepackage{pgf}');
fprintf(fid, '%s\n', '\begin{document}');
fprintf(fid, '%s\n', ['\input{', pgffile, '}']);
fprintf(fid, '%s\n', 'Sample text');
fprintf(fid, '%s\n', 'Sample math $\langle X(t)\rangle$');
fprintf(fid, '%s\n', '\end{document}');
fclose(fid);

Then write another file 'fname2.tex' with the same content but using
FAPPENDL:

fid = fopen('fname2.tex', 'w');
fappendl fid \documentclass{article}
fappendl fid \usepackage{pgf}
fappendl fid \begin{document}
fappendl(fid, ['\input{', pgffile, '}'])
fappendl fid Sample text
fappendl fid Sample math $\langle X(t)\rangle$
fappendl fid \end{document}
fclose(fid);

引用

Mukhtar Ullah (2024). FAPPENDL (https://www.mathworks.com/matlabcentral/fileexchange/18830-fappendl), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2007b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersLow-Level File I/O についてさらに検索
タグ タグを追加

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0