How to transfer “trasfer function” from simulink to matlab

1 回表示 (過去 30 日間)
George Francis
George Francis 2018 年 2 月 20 日
Hello guys I need an advice. As you can see in the picture I have transfer function which I want to transfer to matlab workspace. Parameters are set to a1 = 1, a2 = 10, K = 5.
In "matlab function" block I have code which is below. The code will transfer my "transfer function" into the matlab as a constant (Just one number). But I would like to that it would transfer as individual parameters. So it should return me back same parameters which I set in the beginning (a1 = 1, a2 = 10, K = 5). Can anyone help me?
function tfout = fcn(tfin)
%#codegen
coder.extrinsic('evalin', 'assignin')
tfout=tfin;
assignin('base','tfout',tfout); % Assign value back to workspace

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by