Including functions in App Designer

1 visualizzazione (ultimi 30 giorni)
Luk kim
Luk kim il 18 Dic 2017
Risposto: Melissa Williams il 24 Gen 2018
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.

Risposte (1)

Melissa Williams
Melissa Williams il 24 Gen 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

Categorie

Scopri di più su Develop Apps Using App Designer in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by