MATLAB: If within while loop not recognized

MATLAB

while(t<0.1)
if(t==0.05) v=3; end % NOT GETTING REFLECTED IN v
t=t+Ts;
end

Best Answer

A trivial answer:
Use ismembertol for comparing values with tolerance
tol=1e-6;
if ismembertol(t,0.05,tol)