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

7 views (last 30 days)
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.

Answers (1)

Cris LaPierre
Cris LaPierre on 28 May 2020
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

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!