I am new to MATLAB and trying to use a while function and not understanding why there is no error, but keeps the system busy with no result.
function fac=fact(n);fac=1;while n>0 fac=fac*n; n-1;end
while loop
function fac=fact(n);fac=1;while n>0 fac=fac*n; n-1;end
Best Answer