Sym Function to Simulink

9 ビュー (過去 30 日間)
Tobias Gebhard
Tobias Gebhard 2020 年 8 月 18 日
コメント済み: Tobias Gebhard 2020 年 8 月 25 日
I have a symbolic function that I want to get to a Simulink System.
The parameters may change, so copy and paste to a Matlab/S-Function is not an option.
I found out, with matlabFunction I can create a function handle from the symfun. But getting a function handle to a Simulink function, seems also a problem.

採用された回答

Harshendra Shah
Harshendra Shah 2020 年 8 月 21 日
Hi Tobias,
I think you can use 'matlabFunctionBlock' function to Generate MATLAB Function Blocks from Symbolic Expressions. You can refer to the following link:
There is also an other way to use Symbolic Function inside a Simulink model. Going through following MATLAB Answers post might help you.
I hope this helps.
Regards,
Harshendra
  1 件のコメント
Tobias Gebhard
Tobias Gebhard 2020 年 8 月 25 日
The matlabFunctionBlock is working like intended.
A bit annoying, the slx has to be saved every time. The best solution for dynamic code would be a block that can read a workspace variable containing a symfun or function handle.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConversion Between Symbolic and Numeric についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by