How to compute factorial if input is vector or matrix?
22 views (last 30 days)
I am solving a problem which asks to create a function to express factorial without using build-in functions such as factorial, prod or cumprod.
Actually, I have written down the function.Here is my code:
This function actually works. However I am wondering how to improve my function, if the input is a vector or even matrix rather than a scalar. But I am stuck now because i could not use any build-in functions. Could anybody help me or even just give me some hints for how to do so? Thank you so much.