Set a global variable in a script with multiple functions
3 次查看(过去 30 天)
显示 更早的评论
I have a script that contains about 5 functions and they all need access to a String array.
Is there a way I can only define the string array once in the script but so all the functions can access it?
0 个评论
回答(1 个)
Azzi Abdelmalek
2014-7-12
You can't do it, you have to declare the variable as global in each function
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!