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)
댓글 수: 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!