Advertisement
STANAANDREY

factorial mat

Feb 24th, 2023
1,008
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.12 KB | None | 0 0
  1. function r=fact(n)
  2.     r = 1;
  3.     if n == 0
  4.         return
  5.     end
  6.     for i=2:n
  7.         r = r * i;
  8.     end
  9. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement