Borrar filtros
Borrar filtros

Modify the state variable in a Level-1 MATLAB S-Function

1 visualización (últimos 30 días)
Lotfi
Lotfi el 1 de Oct. de 2019
Comentada: Daniel Sánchez Molina el 14 de Jul. de 2022
Hi
I want to integrate the pulsation to obtain an angle but I must keep this angle between -pi to pi.
I use
function sys = mdlOutputs(t,x,u)
if(x>pi)
x=x-2*pi;
end
sys = x;
but the correction is only made once in the beginning of the simulation, then, x (the angle) is no longer put again to the range -pi to pi
Why is the solver not updating correctly x
Thanks

Respuestas (0)

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by