How to import a transfer function from workspace into simulink?

508 ビュー (過去 30 日間)
azam ghamari
azam ghamari 2019 年 9 月 27 日
コメント済み: shizhao zhang 2020 年 7 月 1 日
Hi guys, I have a problem when I want to use the "from workspace" block in simulink to bring data to simulink, actually I wanted to bring a transfer function from workspace to simulink, not data, and I see that this block just have output port in, not any input , so I can not connect this block from input to another block. How can I bring transfer function from mfile to simulink ?
Any help will be appreciated.
Thank you

回答 (2 件)

Sebastian Johansson
Sebastian Johansson 2020 年 2 月 4 日
A late answer:
Use the Lti-system block from the control system toolbox. Then just enter the name of your transfer function.
  1 件のコメント
shizhao zhang
shizhao zhang 2020 年 7 月 1 日
This is a more elegant implementation.

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


Jesús Zambrano
Jesús Zambrano 2019 年 9 月 27 日
Hi Azam,
One possible solution is:
  1. Create a transfer function in the workscape: for example, type in the command window
F = tf([2],[1 1 1]);
2. In your Simulink model, use a block called "Transfer Fcn" and do double-click on it.
3. In 'Numerator coefficients' write:
F.Numerator{1,1}
4. In 'Denominator coefficients' write:
F.Denominator{1,1}
With this your 'Transfer Fcn' block will have the numerator and denominator coefficients of the trasnfer function you created in the workspace. You can put step 1 in a script, execute it, and the 'Transfer Fcn' block will read the coefficients from the workspace.
Hope this solution is what you are looking for!
Best,
Jesús

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

製品


リリース

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by