Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Why should a business be socially responsible?

Answered: 1 week ago

Question

Discuss the general principles of management given by Henri Fayol

Answered: 1 week ago

Question

Detailed note on the contributions of F.W.Taylor

Answered: 1 week ago

Question

Does it exceed two pages in length?

Answered: 1 week ago

Question

Does it avoid typos and grammatical errors?

Answered: 1 week ago