Filter löschen
Filter löschen

Simulink transfer function with sinusoidal parameter

1 Ansicht (letzte 30 Tage)
River Rock
River Rock am 11 Nov. 2012
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

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 11 Nov. 2012
Bearbeitet: Azzi Abdelmalek am 11 Nov. 2012
You can multiply your transfer function by sin(t)

Weitere Antworten (1)

River Rock
River Rock am 11 Nov. 2012
Your answer does solve the initial problem.
Now how about modifying the parameters of the denominator?
  3 Kommentare
Azzi Abdelmalek
Azzi Abdelmalek am 11 Nov. 2012
You can post another question if you want. And I don't understand, what means Now how about...
River Rock
River Rock am 12 Nov. 2012
Bearbeitet: River Rock am 12 Nov. 2012
Very well then, I will create a new topic.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu General Applications finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by