Matlab functions/scripts

1 回表示 (過去 30 日間)
Bashir Yusuf Bichi
Bashir Yusuf Bichi 2017 年 11 月 19 日
コメント済み: Star Strider 2017 年 11 月 19 日
I have four Matlab functions/scripts and I call all the functions/scripts from one main function, but the results where different when I run the individual functions/scripts. can any one help on how to resolve this issue

採用された回答

Star Strider
Star Strider 2017 年 11 月 19 日
Without seeing them, no.
If you are using global variables, remove the global calls and pass those variables as arguments to each of your functions instead.
  5 件のコメント
Stephen23
Stephen23 2017 年 11 月 19 日
"I thought when sending a variable to both the functions I have to name such variable as global."
When passing variables as arguments (as you should be doing) you should not declare those variables as global.
Star Strider
Star Strider 2017 年 11 月 19 日
@Bashir Yusuf Bichi — As always, my pleasure.
If my Answer helped you solve your problem, please Accept it!
—————
@Stephen — Good point.

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by