Run .m function from GUI

1 次查看(过去 30 天)
I have a GUI that collects user data in the form of numbers. I want the user to hit the pushbutton in the GUI in order to run a function file(.m file) that uses the imputed data of the user to display results
My function file is dish.m
The GUI pushbutton function is 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)
What code do i need to run.

采纳的回答

Image Analyst
Image Analyst 2014-1-25
Call dish():
[out1, out2, out3] = dish(in1, in2); % or whatever arguments it has.
  4 个评论
Philip
Philip 2014-1-25
Thank you very much @ Image Analyst.
Am grateful for you answer and time. This is the code I imputed and it worked fine.
dish(Er,h,Freq);
I realized it's because the dish.m function is receiving values, I need not make it dish ()
Thank you. My GUI is running fine now.
Image Analyst
Image Analyst 2014-1-25
That's fine. You do not need to accept the values it returns if you don't plan on using them.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Whos 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by