Including functions in App Designer

1 回表示 (過去 30 日間)
Luk kim
Luk kim 2017 年 12 月 18 日
回答済み: Melissa Williams 2018 年 1 月 24 日
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 Center および File ExchangeDevelop 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