How to reset time to zero at the change of one value

3 visualizaciones (últimos 30 días)
Sanjeet Kulkarni
Sanjeet Kulkarni el 13 de Sept. de 2022
Editada: VBBV el 11 de Nov. de 2022
I have a function, which takes reminder of time from total time set. What I am trying to do is whenever my cyc = 0 at that instant only the input B of function should be changed. Also, at that instant the time t should reset and start from 0.
Can anyone guide me on how should I do it?
Thanks

Respuesta aceptada

VBBV
VBBV el 11 de Nov. de 2022
Editada: VBBV el 11 de Nov. de 2022
B = 1; % usual input B value
if cyc == 0
B = 3; % input a different B value when cyc = 0
y = myFun(B)
time = 0;
end
function y = myFun(B)
% your function code
end

Más respuestas (0)

Categorías

Más información sobre Simulink en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by