Set a global variable in a script with multiple functions

조회 수: 3 (최근 30일)
Edward
Edward 2014년 7월 12일
답변: Azzi Abdelmalek 2014년 7월 12일
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?

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2014년 7월 12일
You can't do it, you have to declare the variable as global in each function

카테고리

Help CenterFile 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!

Translated by