matlab app designer input time dependent function
2 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone, I'm currently working on an app, in which you should be able to input a time dependent function in the app interface, for example 5*t as an input function for an ode45 integration.
Currently I'm using editfields, what only allows numerical values. Is there a way that i can put in a time dependent function in some kind of edit field for the usage of this function in the code?
3 件のコメント
Rik
2023 年 7 月 4 日
Without showing example code and example inputs it is tricky to help you debug this.
回答 (1 件)
Amit Dhakite
2023 年 8 月 9 日
Hi Marlon,
I understand that you would like to get a time dependent function as an input from the user which needs to be used for ode45 integration.
You can use “Text Area” to take the input of a time-dependent function. This input can then be converted into a string for evaluation. Once evaluated, it can be directly fed into the ode45 integration process.
For the issue regarding integration, you can:
- Make sure that the timespan over which you are integrating is correctly defined.
- Make sure that the user input is parsed and evaluated correctly.
A simple implementation to demonstrate this is attached here.
Hope this helps.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!