How to call global function?
2 ビュー (過去 30 日間)
古いコメントを表示
I want to use all variables used in function workspace, in Base Workspace and vice-versa. That can be possible using script(with certain limit that we can't pass argument)
Is it possible to get all feature of script(mainly working with base workspace variable) in function(mainly argument passing)?
0 件のコメント
採用された回答
Azzi Abdelmalek
2013 年 7 月 15 日
You can use global function
3 件のコメント
Azzi Abdelmalek
2013 年 7 月 16 日
In the workspace type
global x y z % x,y z are your variables
% do the same thing inside your functions
function b=fcn(a)
global x y z
Jan
2013 年 7 月 18 日
@Pramit: Please consider, that global variables are one of the most hated bad programming patterns, In growing programs they increase the complexity such that debugging can become impossible.
Passing input and output arguments would be much smarter. Why don't you want / aren't you able to pass arguments?
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Whos についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!