RE. Guide

  • Follow


I created a simple GUI panel with text boxes for parameter entries and a button to run a computational  routine.

My question is  when the computational routine is called inside the button click  call back function,  I want to be able to access returned variables in the interpreter for plotting analysis.

for example. here is the outline of my GUI skeleton (not syntaxially written)

button_call_back()

output=routine(parameters extracted from text entries)

end

How do I access the variable "output" in the interpreter later on! Once the GUI quits after my routine returns I cannot seem to access the variable in the interpreter
0
Reply Vivek 11/15/2010 8:30:07 PM

"Vivek varadarajan" <v_varada@uncg.edu> wrote in message <ibs58e$6kq$1@fred.mathworks.com>...
> I created a simple GUI panel with text boxes for parameter entries and a button to run a computational  routine.
> 
> My question is  when the computational routine is called inside the button click  call back function,  I want to be able to access returned variables in the interpreter for plotting analysis.
> 
> for example. here is the outline of my GUI skeleton (not syntaxially written)
> 
> button_call_back()
> 
> output=routine(parameters extracted from text entries)
> 
> end
> 
> How do I access the variable "output" in the interpreter later on! Once the GUI quits after my routine returns I cannot seem to access the variable in the interpreter'

Hints:
doc setappdata
doc getappdata
0
Reply Sean 11/15/2010 10:40:08 PM


Here is my function from a button click callback and as you will see CSCmain is the name of my routine and it returns a variable "uv" , I want to be able to access uv in the workspace for post analysis

function pushbutton2_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
epsilon=str2double(get(handles.epsbox,'String')) ;
zetas=str2double(get(handles.zetabox,'String')) ;
vr=str2double(get(handles.vrbox,'String')) ;
lam=str2double(get(handles.lambox,'String')); 
T=str2double(get(handles.periodbox,'String')); 
Amp=str2double(get(handles.amplitudebox,'String')) ;
dx=str2double(get(handles.dxbox,'String')) ;
dt=str2double(get(handles.dtbox,'String')) ;
CSCgui('visible','off')
close('CSCgui')
tic
[uv]=CSCmain(epsilon,zetas,lam,vr,Amp,T,dx,dt,15,6);
end
?? 

"Vivek varadarajan" <v_varada@uncg.edu> wrote in message <ibs58e$6kq$1@fred.mathworks.com>...
> I created a simple GUI panel with text boxes for parameter entries and a button to run a computational  routine.
> 
> My question is  when the computational routine is called inside the button click  call back function,  I want to be able to access returned variables in the interpreter for plotting analysis.
> 
> for example. here is the outline of my GUI skeleton (not syntaxially written)
> 
> button_call_back()
> 
> output=routine(parameters extracted from text entries)
> 
> end
> 
> How do I access the variable "output" in the interpreter later on! Once the GUI quits after my routine returns I cannot seem to access the variable in the interpreter
0
Reply Vivek 11/16/2010 7:36:04 PM

You made this nice GUI for your user, and then when you exit  you're
going to force the user to interact with MATLAB command line functions
in the "interpreter" (command window)?  Why do this to them?  Just
handle everything in the GUI.

If you still insist on making it less convenient for your users, then
take a look at evalin() and assignin().
0
Reply ImageAnalyst 11/16/2010 10:56:00 PM

Well I completely understand your reply, its the whole point of making a GUI, 
but right now I am the only user and I wrote the GUI to make analysis for me easier faster and also to gain GUI programming  experience along side.

So once again yes , my intention is once the GUI is exited as you mention rightly, I want to be able to access  the variable output uv in the interpreter?
I will try evalin and asisignin 

Thanks

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <4ea16389-fa96-43da-bb24-4c72e7de9dbc@s5g2000yqm.googlegroups.com>...
> You made this nice GUI for your user, and then when you exit  you're
> going to force the user to interact with MATLAB command line functions
> in the "interpreter" (command window)?  Why do this to them?  Just
> handle everything in the GUI.
> 
> If you still insist on making it less convenient for your users, then
> take a look at evalin() and assignin().
0
Reply Vivek 11/17/2010 2:22:04 AM

4 Replies
238 Views

(page loaded in 0.061 seconds)

Similiar Articles:













7/26/2012 8:37:05 AM


Reply: