Regarding discrete integration through ode45
6 次查看(过去 30 天)
显示 更早的评论
Hi,
I am studying a software written in simulink, which includes the signal integration block. The entire system is in a closed loop, where the current input to the integration block is dependent on the previous value given at the output of the block. Basically, the input to the block is a complex function. It is mentioned in the solver pane that the ode method used is ode45.
My intention is to convert the entire simulink block to a pure MATLAB/C code. Is it possible to know how the discrete integration is implemented by MATLAB/Simulink?
Thank you, Varad.
0 个评论
采纳的回答
Arnaud Miege
2011-4-6
Can I ask why you want to convert the Simulink model to MATLAB or C code?
Simulink use complex semantics and mechanisms to solve the underlying mathematical equations of the system (see How Simulink Works and Choosing a Solver in the documentation for more details). It's not possible to convert a Simulink model to MATLAB code, which is why I ask what are the reasons for doing so.
It is however possible to automatically generate C code from Simulink models with Real-Time Workshop. This is typically for embedding control or signal processing algorithms onto real-time embedded systems, but can also be use for speeding-up simulations, integrating in larger simulation environments, batch processing, etc...
HTH,
Arnaud
2 个评论
Arnaud Miege
2011-4-7
I wouldn't recommend doing a manual translation. Express your software in Simulink and then use Real-Time Workshop to generate the C code. Once the model is configured correctly to generate the C code, it's very easy to make modifications to the model and regenerate the code, rather than having to manually recode it and introducing potential coding errors.
Arnaud
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 General Applications 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!