The factorial n! of a positive number (integer) is defmed byn! = n(n-1)(n-2 ). .. 321

Chapter 7, Problem 11

(choose chapter or problem)

The factorial n! of a positive number (integer) is defmed byn! = n(n-1)(n-2 ). .. 321, where 0! = 1. Write a user-definedfunction that calculates the factorial n! of a number. For function name andarguments, use y=fact (x), where the input argument x is the numberwhose factorial is to be calculated and the output argument y is the value x! .The function displays an error message if a negative or non-integer number isentered when the function is called. Do not use MATLAB built-in functionfactorial. Use fact with the following numbers:(a) 9! (b) 8.5! (c) 0! (d) -5!

Unfortunately, we don't have that question answered yet. But you can get it answered in just 5 hours by Logging in or Becoming a subscriber.

Becoming a subscriber
Or look for another answer

×

Login

Login or Sign up for access to all of our study tools and educational content!

Forgot password?
Register Now

×

Register

Sign up for access to all content on our site!

Or login if you already have an account

×

Reset password

If you have an active account we’ll send you an e-mail for password recovery

Or login if you have your password back