# final 1234

1. a) Create a new file for question #1. Run this command in the Matlab EDITOR WINDOW:

Q = randi ([1 10],3,5)

1. b) Create a 4×5 matrix called A that selects random numbers from 0 to 35 using “randi”. Type your command in the EDITOR WINDOW. Save your workspace.

1. c) How many numbers need to be changed in order to have no repetitions? Write it down in the EDITOR WINDOW as a comment. Copy this answer into your answer sheet.

1. d) Using the COMMAND WINDOW, if a number is repeated, change the other number(s) to a unique number that is not shown in the matrix using the same range 0-35. To do this use a command that designates which row and column to change the repeated numbers in your matrix into a non-repeated number of your choice. You should obtain a 4×5 matrix with 20 unique numbers in the given range after completion.

Copy and paste all the commands with the results into your answer sheet.

1. e) Change the name of your matrix to a double letter if the old one was called A, call the new one AA. Save your workspace.

1. a) Create a new file for this question. In the new matrix (AA), look at the First Row and write down which row and column has the smallest number in the First Row. (for example AA(1, 6) ). Write it down as a comment in the EDITOR WINDOW.

2. b) In the EDITOR WINDOW, write a command to calculate the square of all elements in that column found in part (a). Name it AASq for example: AASq = …. Note that AASq should be a 5×1 matrix.

2. c) In the EDITOR WINDOW, write a command to replace the column with the next lower number with AAS. Copy the result into your answer sheet. Name the new matrix B. Save your workspace and save your editor file.

** Note that if you make a mistake in question 2, because the values of the matrix AA may change, in order to redo, write in the Command Window: AA = A. Then start again from part 2 (a).

1. a) Create a new file for question #3. Run this command only once in the MATLAB EDITOR WINDOW. You will lose points if you run it more than once:

Q = randi ([8],1)

3. b) Use the Intermediate Value Theorem to determine whether each of the following equations has at least one solution in the given intervals. Select the question below based on the number you obtained from question 3 (a). (For example, if part 3 (a) = 8, you will select question #8 below). In the EDITOR WINDOW, write the appropriate commands to solve the problem.

Copy the result into your answer sheet. State why you think there is a solution if any.

1. a) Create a new file for question #4. Run this command only once in the Matlab EDITOR WINDOW. You will lose points if you run it more than once:

S = randi ([8],1).

Find the second Taylor Polynomial P2 (x) about the point x0 = 0

Select the question below based on the number you obtained from question 4 (a). (For example, if part 4 (a) = 8, you will select question #8 below).

Let f(x) =

In the EDITOR WINDOW, write the appropriate commands to find the second Taylor Polynomial by following the directions below.

4. b) Calculate and Copy the result for f and f(x0) into your answer sheet.

4. c) Calculate and Copy the result for first derivative f’ and f’(x0) into your answer sheet.

4. d) Calculate and Copy the result for second derivative f’’ and f’’(x0) into your answer sheet.

4. e) Calculate and Copy the final result P2(x) into your answer sheet.