factorial command wont accept the input of n in () and keeps asking for n
1 view (last 30 days)
The factorial comand keeps ignoring the inpu I put in brakets and repeteadly asks for n and I can't figure out why. Its really annoying because whenever I put factorial in a script, it completely ignores the values that the script inputs and keeps asking for n, rendering the script useless.
essentialy what I want to happen is
what happens is
ans = input!
so if I do factorial(5) but input 3 upon it asking for n I get 6 instead of 120
Sahil Jain on 15 Nov 2021
Hi Christopher, the MATLAB "factorial" command does not prompt for inputs. It looks like there's another "factorial" function on the MATLAB path which is being executed. Try using the "which" command to determine which factorial function is being run.