Including functions in App Designer

1 次查看(过去 30 天)
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.

回答(1 个)

Melissa Williams
Melissa Williams 2018-1-24
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

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by