Matlab Gui. Retrieve the output of a function (external .m file) within a push button. Could anyone explain how to do it?

5 Ansichten (letzte 30 Tage)
Hello I'm new about use the Matlab Gui. I'm struggling to retrieve the output of a function (external .m file) in a push button. Could anyone explain how to do it?
%code
function Simulate_Callback(hObject, eventdata, handles)
% hObject handle to Simulate (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global w DP
T=str2double(get(handles.inT,'string'));
P=str2double(get(handles.inP,'string'));
delta=str2double(get(handles.indelta,'string'));
Comp=str2double(get(handles.Comp,'data'));
Comp=Comp(:,1);
[w,DP]=external_Function(T,P,delta,Comp);

Akzeptierte Antwort

Davide Dall'Acqua
Davide Dall'Acqua am 23 Sep. 2017
Thanks for your quick reply. I found my error. It was a waitbar in my external function that once completed the function it closed the entire gui

Weitere Antworten (1)

ES
ES am 23 Sep. 2017
Bearbeitet: ES am 23 Sep. 2017
Whatever you have done so far is fine. Just that there needs to be a external_Function.m file with the function defined as [w,DP]=external_Function(T,P,delta,Comp).
of course you need not specify w and DP as globals.

Kategorien

Mehr zu Introduction to Installation and Licensing finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by