Question: answer question 5. I've added the previous questions just if needed. Use matlab and show the work from command window take a pic of the

 answer question 5. I've added the previous questions just if needed.

answer question 5. I've added the previous questions just if needed. Use matlab and show the work from command window take a pic of the command window I dont want written stuff can not understand it.

1. Do the following in the Command Window: create variables corresponding to the letters of your first name and surname and assign numbers to these variables that correspond to the places of the letters in the alphabet. For example, if you are 'John Doe', you should type: >> J = 10; 0 - 15; h - 8; n - 14; D-4; e = 5; Now create the row-vector myvec with elements that spell your name, as in >> myvec = [John Doel; Save myvec in a file myname.mat. Clear all variables from the Workspace. Load the file myname.mat into the Workspace 2. With a single command, which uses functions mod and sum, determine how many numbers in myvec are divisible by 3. 3. With a single command, which uses reshape and the colon operator, create a 5-by-4 matrix A from the elements of myvec. If the number of elements is not sufficient, reuse the elements from the beginning. For example, if myvec = 110 15 8 14 4 15 5), then A = [10 15 14 15 15548 10 15 14 15 5 8 10 15) 4. Write a function with header (A, Vj - myCone (r, h), which outputs the total area A and volume V of a cone with base radius r and height h. 5. Write a function A - myMatrix (myvec, m, n) which creates an m-by-n matrix A, as in Problem 3, but for arbitrary values of m and n and any length of vector myvec. Hint: the function can use the built-in Matlab functions length, mod, and reshape, as well as either a repmat function or a loop. 6. Define an anonymous function heron which calculates the area of a triangle with sides a, b, and c using Heron's formula. Use this function to calculate the area of a triangle with sides a myvee (1) + myvee (2). myvec (1) +myvec (3), and myvec 12 ) myvee (3), where myvee is your answer to Problem 1. 7. Write a function x = realRoots (a, b, c) which outputs real roots of the quadratic equation ax + bx + C=0. If there are no real roots, then the output is x = . Demonstrate the performance of your function on three examples which generate two, one, and no real roots Consider a triangle with vertices at (1.0), (1.0), and (0.1). Write a function with the headers insideTriangle(x, y) where s is the string 'outsider if the point with coordinates his outside the triangle, "border' if the point is exactly on the border of the triangle and inside if the point is inside of the triangle. Test you function on the following cases: (0.5, 0.5),(-1, 1), and (0.0.5)

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!