How to load matlabFunction output into Simulink

3 ビュー (過去 30 日間)
Aaron Inks
Aaron Inks 2021 年 9 月 15 日
回答済み: Paul 2021 年 9 月 15 日
I have a very complicated matrix inversion. I turned the resulting matrix into a function using matlabFunction. I need to find a way to evaluate the resulting function in simulink.

回答 (2 件)

Paul
Paul 2021 年 9 月 15 日
matlabFunctionBlock can be used to generate a block directly into the Simulink model from the symbolic expression. It will only be availabe in Simulink. If you need the function in Matlab and Simulink, then use matlabFunction with the 'file' option and then call that m-function from inside a Matlab Function block in the Simulink model.

Walter Roberson
Walter Roberson 2021 年 9 月 15 日
When you use matlabFunction(), give it the 'file' option to write the code into a file. After that, you can use the file name as a function name just like any other .m file.

カテゴリ

Help Center および File ExchangeInteractive Model Editing についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by