フィルターのクリア

function refresh value when variable changes (pass by reference)?

9 ビュー (過去 30 日間)
Howie
Howie 2013 年 7 月 17 日
コメント済み: Hossein Azarm 2020 年 4 月 12 日
Would it be possible to refresh a function's value?
Say, A =1; B = 1; f = [A B]
Now, if I change A = 3, how should I change f's value without typing f = [A B] again?
It is essentially just like pass by reference, but I thought it is very complicated to do that in Matlab if possible.
This problem occurs because I may want to add variable c to f later, so f = [A B C], and in that way I just need to declare f in the beginning and do not have to change f everywhere.

回答 (1 件)

David Sanchez
David Sanchez 2013 年 7 月 17 日
Your question is answered in another post, follow the link:
href = ""<http://www.mathworks.com/matlabcentral/answers/152</a>>
  2 件のコメント
Howie
Howie 2013 年 7 月 17 日
Hi, the link is just this post
Hossein Azarm
Hossein Azarm 2020 年 4 月 12 日

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

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by