필터 지우기
필터 지우기

how to acceess variable from another function in GUI ?

조회 수: 4 (최근 30일)
alex
alex 2012년 3월 9일
I have a question say i building a gui that's loads file if data(array of double ) and calculates and plots a result so in gui,there is 'load file' push button,which has a callback function 'calculate and plot' push button,which also has a function callback
how can i access a data in 'calculate and plot' function callback ? when i doing debug there is no such variable ! F1 !

채택된 답변

Walter Roberson
Walter Roberson 2012년 3월 9일
  댓글 수: 3
Walter Roberson
Walter Roberson 2012년 3월 9일
Use a shared variable, or store the data in your handles structure via guidata(), or use setappdata(), or store the data in the UserData field of some object, or use a persistent variable, or use a global variable.
You can take any of these approaches.
In the place you need to use the data, retrieve it from where-ever you stored it.
alex
alex 2012년 3월 10일
Thank you !
now it works !

댓글을 달려면 로그인하십시오.

추가 답변 (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