hs_fun.m function fx=hs_fun(x) if x>=100 exit end prd=1; for k=1:x prd=prd*k; end prd >> hs_fun(5) prd = 120