フィルターのクリア

How to overwrite built-in fprintf

8 ビュー (過去 30 日間)
julia
julia 2011 年 3 月 14 日
I’d like to know if there is any way to overwrite fprintf built-in function? I wan to add some my own action in fprintf function before I call the built-in fprintf. I know how to overwrite disp, but I do not know how to overwrite fprintf. I’d like to know if it is possible. Could you please help? Thanks.
Julia

採用された回答

Matt Fig
Matt Fig 2011 年 3 月 14 日
You cannot overwrite it, but you can mask it. Put a new M-file in your directory called 'fprintf.m' Then when you call FPRINTF, MATLAB will actually call your function. From within your function, you can access the built in version by using the BUILTIN function.
I will leave alone questions of why you would want to overload such a great function in the first place!
  1 件のコメント
julia
julia 2011 年 3 月 22 日
Thanks a lot for your helps.
Julia

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCell Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by