Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a MATLAB script file HW4P3.m to do the following problems: i. (12 pts) Define the vectors U = [-5 -4 -3 -2], v =

image text in transcribed

Write a MATLAB script file HW4P3.m to do the following problems: i. (12 pts) Define the vectors U = [-5 -4 -3 -2], v = (5 4 3 2] using the "." operator. Then using only the vectors U and/or V, in elementwise operations, create the following vectors: (a) A = [0000] (b) B = [(-5)5 (+4)* (-3); (2)2] (CC = les sa il (d) D = [-1 -1 -1 1] (C) E = E= 1; F = [20 12 6 2] ii. (4 pts) Using the linspace function, create x = [0.5, 1, 1.5, 2, 2.5] and y = [0.8, 1.6, 2.4, 3.2, 4], then use them in the following expression to calculate z using elementwise calculations. z = xyey/* 3x4y3 + 8.5 iii. (9 pts) The radius, r, of a sphere can be calculated from its volume, V, by: The surface area of a sphere, S, is given by: S = 49r2 Determine the radius and surface area of spheres with volumes of 4,000, 3,500, 3,000, 2,500, 2,000, 1,500 and 1,000 in3. You must initialize the vector V for the volume using short cut expressions, DO NOT enter the values explicitly. Your script must display the results in a three column matrix where the values of r, V, and S are displayed in the first, second, and third columns, respectively. The values of rand S that are displayed in the matrix should be rounded to the nearest tenth of an inch

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

Step: 3

blur-text-image

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

Explain methods of metal extraction with examples.

Answered: 1 week ago