フィルターのクリア

Find variables in a function that depend on a certain variable

1 回表示 (過去 30 日間)
K E
K E 2012 年 5 月 1 日
I have a function with many calculations in it. I want to identify all the variables within that function that were calculated from a certain variable, even indirectly. For example,
bankBalance = 100 ;
groceries = bankBalance*0.8 ;
iceCream = groceries*0.1 ;
In this case, I want to identify both groceries and iceCream as variables that depend on bankBalance, even though bankBalance doesn't appear in the iceCream calculation. In reality there are 50+ variables derived from my chosen variable, and 200+ that are not. How can I list all variables that depend on a chosen variable within the function? I could set bankBalance to NaN and see which variables become NaNs, but perhaps there is a better way.

回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by