Question: MATLAB question: 4. (6 points) A vector is given by x = [9, 4, 0,7]. Write a MATLAB program (a3q4.m) that creates the vector x,
MATLAB question:

4. (6 points) A vector is given by x = [9, 4, 0,7]. Write a MATLAB program (a3q4.m) that creates the vector x, then creates a matrix M from this vector. The matrix M has four rows, as follows: The original vector, x The reciprocal of x The factorial of the elements in x computed using the myFactorial function from the last question The factorial of the elements in x computed using MATLAB's factorial function. Output the matrix M, with a ruler line above and below. For the numeric output, use MATLAB's fprintf function, creating the four lines of output in a single statement that executes once. For each value, use a field width of 15 characters, including 4 decimal places. The following is the desired output: --------------- 9.0000 0.1111 362880.0000 362880.0000 4.0000 0.2500 24.0000 24.0000 0.0000 Inf 1.0000 1.0000 7.0000 0.1429 5040.0000 5040.0000
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
