Export transfer function model to workspace from Simulink without linmod

I want to export the trasfer function of a simple simulink program to the workspace. I know it can be done simply by using the commands
[a,b,c,d]=linmod('model')
sys=ss(a,b,c,d);
tf(sys)
Is there any way to avoid the linmod command? The reason I need to do this is to present this method for people who are not familiar with state-sspace models.

1 件のコメント

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 10 月 18 日
Lazaros commented
Isn't there anyone who can help me with this? Thanks again in advance!

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

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 10 月 14 日
編集済み: Azzi Abdelmalek 2013 年 10 月 14 日
Edit
Your model name is transfer, and you have two transfer function named Transfer Fcn and Transfer Fcn1
To get the parameters of Transfer Fcn block
num=get_param('transfer/Transfer Fcn','Numerator');
den=get_param('transfer/Transfer Fcn','Denominator');
model=tf(str2num(num),str2num(den))

8 件のコメント

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 10 月 14 日
Look at Edit
Lazaros Moysis
Lazaros Moysis 2013 年 10 月 14 日
Though this is helpful, I actually want to get the trasfer function of the whole system (in this case the series connection), not just the tf of a single block.
num=get_param('transfer/Transfer Fcn','Numerator');
den=get_param('transfer/Transfer Fcn','Denominator');
num1=get_param('transfer/Transfer Fcn1','Numerator');
den1=get_param('transfer/Transfer Fcn1','Denominator');
model=tf(str2num(num),str2num(den))
model1=tf(str2num(num1),str2num(den1))
modelg=model*model1
Lazaros Moysis
Lazaros Moysis 2013 年 10 月 14 日
編集済み: Lazaros Moysis 2013 年 10 月 14 日
You do not understand the point of my question sir. If i am to do all this, of course i might as well not use simulink at all. The question is how can i get the transfer function of a simulink model, without having to use the linmod and the ss command. The model in question could be 10 times more complex, the question remains the same
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 10 月 18 日
When you read the help of linmod, nothing is referring to an equivalent function, which make me think there is not another way. I think also Its the way simulink stores your model (linear or non linerar), even when you use a transfer function, I think, simulink stores it as state space representation.
Lazaros Moysis
Lazaros Moysis 2013 年 10 月 18 日
Yes this is what i think too, that the models are generated as state-space representations, but since simulink has too many different paremeters to check, I thought maybe there was a way i did not know.
haryana thomas
haryana thomas 2018 年 8 月 21 日
you should type this command in the matlab command line.
plant = linearize('name of simulink model')
tf(plant)
Raja Singh R
Raja Singh R 2020 年 8 月 13 日
Thomas, It is showing empty transfer function

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

カテゴリ

ヘルプ センター および File ExchangeSimulink についてさらに検索

質問済み:

2013 年 10 月 14 日

コメント済み:

2020 年 8 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by