Question: Please use Matlab to complete. please comment code. Problem 2: The factorial of a positive integer number is defined by n!- n (n-1) (n-2) (3)

Please use Matlab to complete. please comment code.

Please use Matlab to complete. please comment code. Problem 2: The factorial

Problem 2: The factorial of a positive integer number is defined by n!- n (n-1) (n-2) (3) (2) (1), where 0!1. Write a user-defined function that calculates the factorial n! . For function name and arguments, use y = fact (x) , where the input argument x is the given number and y is the value of Write a script Caller_fact.m which asks the user for the number. If the number is negative or non integer, the error message should be displayed. Otherwise the fact will be called and the factorial of the given number will be calculated and displayed. Do not use MATLAB built-in function factorial0. Use fact with the following numbers: a) 9! b) 8.5! c) 0! d) -5! Hint: A number is non-integer when: floor(x)x

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!