Including functions in App Designer

1 vue (au cours des 30 derniers jours)
Luk kim
Luk kim le 18 Déc 2017
Hello, I'd like to make a simple app using App Designer that would take user input for three variables via numeric edit field and when the button is pushed it plots ode45 solution on UIAxis.
I have a function that works in Matlab (attached to the post as lqe.m) that you run by using this two lines of code
[t,y]=ode45(@lqe, [0 1200], [1 0]);
plot (t,y)
Now, I'd like to make GUI in App Designer as mentioned above. I've only made simple apps that haven't required using long functions like this one. I've tried putting the function in methods section of App Designer but it didn't work. My AppDesigner file is attached as LQ.zip, if you want to look at it. I'm using 2016a version of Matlab.
If anyone could point me in right direction I'd really appreciate it.

Réponses (1)

Melissa Williams
Melissa Williams le 24 Jan 2018
Luk, Putting the function in the methods block of the app is one option, another is just calling the external function from the app. If you put it in the methods block of the app, you will need to pass app as the first input argument.
In the app you attached, you are missing some app properties and also not passing enough input arguments when calling lqe.
-Melissa

Catégories

En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by