Using Syntax fprintf('...\n'), to call two functions

1 回表示 (過去 30 日間)
Ahmad
Ahmad 2013 年 10 月 21 日
コメント済み: Ahmad 2013 年 10 月 21 日
Hello everyone,i'm working on a brewery process system with matlab, i used the syntax disp(sprintf('...')) in order to call two functions i found out that i can save memory by using the syntax fprintf('...\n'), if i use the syntax fprintf('...\n'), how will i maintain behaviour?
Thank you.

採用された回答

Image Analyst
Image Analyst 2013 年 10 月 21 日
sprintf() writes to a string. You don't need disp to write it to the command window, you can just use sprintf() and leave off the semicolon. Similarly fprintf() writes to the command window if the file handle is 1 or no file handle is given, or to a file if you pass it the file handle you got from fopen(). You can use fprintf() and maintain the same behaviour as when you used disp(sprintf()). Did you actually try some things and observe how they behave? That is a good way to learn.
  1 件のコメント
Ahmad
Ahmad 2013 年 10 月 21 日
Oh thank you, this quite worked out now.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by