Hold the same values of else
    2 views (last 30 days)
  
       Show older comments
    
Vadc <Vdisp is no longer true for the first time and I want the values to hold the same values of else even if Vadc <Vdisp is true again.
function [G,S]    = f(H,clock,T,Vadc,Vdisp,R)
if (clock>T+R+0.2)
    if (Vadc<Vdisp)
        G=H;
        S=1;
    else
        G=pulse;
        S=0;
    end
else
    G=H;
    S=1;
end
3 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
