Matlab: factorials without for loops or colon

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 3K views
koryargonic
Messages
3
Reaction score
0
The Problem: Write a function that finds the factorial of a positive integer without using for or while loops, the factorial function, or the : range operator.

Honestly, I don't really know how to start with this one. If I were able to use a for loop it would be easy, and I don't see how I can do this with conditionals. Any ideas/hints?
 
Physics news on Phys.org
Think recursion.
 
Ooh, thanks. I got it.