필터 지우기
필터 지우기

gui

조회 수: 1 (최근 30일)
pawan kumar
pawan kumar 2011년 9월 17일
in gui programming if any variable is defined in push button(or toggle button). then this variable is not accepted by programme in other button in same gui programming
eg:.
push button1
a = [1 2 3 4];
push button2
xlswrite('a.xlsx',a)
this gives undefined variable a; please help me regarding this
thanks pawan kumar

채택된 답변

TAB
TAB 2011년 9월 17일
In matlab, scope of a variable is limited to the function in which is declared. If u want to share the variable between multiple functions, then declare it as 'global' in each function which access it. In your case it should be
push button1
global a;
a = [1 2 3 4];
push button2
glabal a;
xlswrite('a.xlsx',a);
Find more on

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by