How to pass a value to a function which is external to GUI?

3 views (last 30 days)
I have designed a program to calculate values and display graphs using multiple functions and global variables. the code works very fine. Now i want to add a GUI to make it more user friendly but cannot pass values and strings into the functions that are external to the GUI. Am using a pushbotton to invoke the function and pass values to it.
My Push button callback looks like this:
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
Any method on how to go by this?

Answers (1)

Walter Roberson
Walter Roberson on 25 Jan 2014
What constraints are blocking passing values in to the external functions? Do the external functions not take parameters ?
  4 Comments
Philip
Philip on 25 Jan 2014
Thank you Walter.
design_patchr is a function which I have initialized outside the GUI as global. It receives (Er,h,freq_config) and does some other computations and returns the value to another function called patchr_config which also does some computations and returns values to another function.
Maybe I am not getting your queries right. But is it possible to pass values to an external function that is of itself global?
I learnt about GUIdata but don't know how to incorporate it into the programe
Philip
Philip on 25 Jan 2014
But the other option I was thinking about is to run the main m.file from the push button.
How about that also?

Sign in to comment.

Categories

Find more on Event Functions in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!