How to pass parameters between local functions of uicontrol, pushbutton?

I am writing a program in which a figure is created. I have added 3 uicontrol pushbuttons. the idea is this: user can select the desired part of data by one of pushbuttons and save the selected part by another pushbutton. if he/she doesn't want to save is able to cancel the selected part by the other pushbutton,'cancel'.
My problem is that I can not pass parameters from one local function of pushbutton to the other one I mean matlab forgets the variables created in one local function when it goes out of it. what can I do?

 채택된 답변

Dishant Arora
Dishant Arora 2014년 5월 15일

0 개 추천

How can I share data between callback functions in my GUI(s)? Make use of setappdata, getappdata or global variables as shown.

댓글 수: 2

thank you for your help but it didn't work again. you know the problem is that local functions of uicontrol work completely independent and at least I can not pass parameters between them. what I did for solving this problem is to get the handles of the lines (which are drawn as the data is selected) and delete them!!! perhaps not a good solution but it works. I think that as much as I know we cannot pass parameters betwwen these local functions unless we save them in a .mat file.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

질문:

2014년 5월 15일

댓글:

2014년 5월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by