How can I run a function on app designer using a push button?

I am attempting to run a function which can be run freestanding outside of app designer, however I have a few of the sam functions I would like to pair in a GUI. I keep getting the following error associated to the lines of code which follow it:
Error using Hip_Analysis_App
Too many output arguments.
Error in Interface_5_26_2020/HipButtonPushed (line 49)
app.Hip
Line 34-36: function Hip(app)
app.Hip = Hip_Analysis_App;
end
Line 48: function HipButtonPushed(app, event)
Line 49: app.Hip
Any help resolving this issue would be greatly appreciated.

답변 (1개)

Cris LaPierre
Cris LaPierre 2020년 5월 28일
Based on the error message, it appears your function Hip_Analysis_App does not have any outputs. Check your function declaration in the file.
If it look like this
function Hip_Analysis_App
call your function in the app like this
Hip_Analysis_App;
Also note that the function has to be in the current folder or on the MATLAB path.
If your function is supposed to be returning a value, then update your function declaration to place the output variable in the declaration (out here)
function out = Hip_Analysis_App

카테고리

도움말 센터File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품

릴리스

R2018a

질문:

2020년 5월 27일

답변:

2020년 5월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by