Simulink transfer function with sinusoidal parameter

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

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2012년 11월 11일
편집: Azzi Abdelmalek 2012년 11월 11일

1 개 추천

You can multiply your transfer function by sin(t)

추가 답변 (1개)

River Rock
River Rock 2012년 11월 11일

0 개 추천

Your answer does solve the initial problem.
Now how about modifying the parameters of the denominator?

댓글 수: 3

That was not your question!
You can post another question if you want. And I don't understand, what means Now how about...
River Rock
River Rock 2012년 11월 12일
편집: River Rock 2012년 11월 12일
Very well then, I will create a new topic.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터 및 File Exchange에서 General Applications에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by