Question: Help me write a MatLab code. O Create a function called myFact.m that takes the input of a scalar N and outputs the factorial of
O Create a function called myFact.m that takes the input of a scalar N and outputs the factorial of that number. Factorial Example: Factorial of 4 = 4' = 4*3*2*1 = 24 General Form: N. = N"(N-1)*(N-2)*(N-3)* 3*2*1 O Write a script caled testFact.m that compares your function to the MATLAB function factorial (N) by calling each and comparing the outputs to check if your function returns the correct values. If both values agree, print an output formatted like the example below for the value of N called: myFact.m and factorial both compute 4to be 24
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
