Question: THis is a matlab question. I need the code pleaser. 4. (25 points) Write a MatLab program that calculates and prints out the factorial of

THis is a matlab question. I need the code pleaser. 4. (25THis is a matlab question. I need the code pleaser.

4. (25 points) Write a MatLab program that calculates and prints out the factorial of a number entered by the user (via an input O statement). The program must use a for loop to do the calculation and cannot use MatLab's built-in factorial) function The factorial of a number N, written as NI, is defined to be f N is 0 or 1 if N is a positive integer if N is negative or not an integer N! = N*(N-1) * .. . *3+2+1 undefined Note that your program will need to check for the special cases of N-0 or 1, N negative, or N not an integer, and produce an appropriate result or error message for each case. Hand in a printout showing your program's output for the factorial when each of the following numbers are entered as input: HINT: To see if a number is an integer or not, make use of MatLab's round () function, which rounds any number to the nearest integer, and compare that result with your original number This is a MATLAB problem. I need the code please

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!