![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/172102/image.jpeg)
Simulink transfer function with sinusoidal parameter
2 ビュー (過去 30 日間)
古いコメントを表示
Hi
I need to design a transfer function in the following form: K/ (Ts + 1) where the numerator K is scalar and varies sinusoidal
I tried adding and event listener on the start callback
iev = add_exec_event_listener('main\le_block','PostOutputs', @vary_me)
the vary_me function looks like:
function vary_me
a=evaluatevars('tout');
a=a(end);
a=sin(a);
set_param('main/le_block','Numerator',num2str ( sin(a) ) );
I noticed the following error
Warning: Error occurred while evaluating listener callback.
Error using vary_me
Too many input arguments.
How should I solve this issue? Is there any easier way to implement the same behavior (sinusoidal-varying numerator of transfer function) ?
Thanks for any reply
0 件のコメント
採用された回答
Azzi Abdelmalek
2012 年 11 月 11 日
編集済み: Azzi Abdelmalek
2012 年 11 月 11 日
You can multiply your transfer function by sin(t)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/172102/image.jpeg)
0 件のコメント
その他の回答 (1 件)
River Rock
2012 年 11 月 11 日
3 件のコメント
Azzi Abdelmalek
2012 年 11 月 11 日
You can post another question if you want. And I don't understand, what means Now how about...
参考
カテゴリ
Help Center および File Exchange で Model, Block, and Port Callbacks についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!