How to pass a value to a function which is external to GUI?
Show older comments
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
on 25 Jan 2014
0 votes
What constraints are blocking passing values in to the external functions? Do the external functions not take parameters ?
4 Comments
Philip
on 25 Jan 2014
Walter Roberson
on 25 Jan 2014
Like it says, your index is out of range. Are you sure you want to be indexing the array design_patchr with a third index that is in the range of millions ? Or are you expecting that design_patchr is a function handle?
Where did you initialize design_patchr? In that routine did you remember to declare design_patchr as global ?
Philip
on 25 Jan 2014
Philip
on 25 Jan 2014
Categories
Find more on App Building 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!