Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Difficulty: Easy Exercise 5 (3 The area of a parallelogram in 2 , built on non-parallel vectors y, v, and the volume of a parallelepiped

image text in transcribed

Difficulty: Easy Exercise 5 (3 The area of a parallelogram in 2 , built on non-parallel vectors y, v, and the volume of a parallelepiped in 3, built on vectors v1,V2,V3-which do not lie in the same plane, is det (or abs(det A)), where [v1 v2] and = [v1 v2 v3], respectively. (See Section 3.3 of the textbook for details.) In this exercise, you will be given 2 vectors in 2 , v1 and v2-or 3 vectors in 3, v1,V2-and v3 on which a parallelogram or parallelepiped, respectively, may or may not be built. **Create a function in MATLAB function D = areasol(A) which takes as an input a matrix A, whose columns are the vectors on which a parallelogram or parallelepiped may possibly be built *First, your function has to check whether the given vectors are linearly independent. I recommend using the function rank to verify that. If it is not the case, then a parallelogram in 2 or parallelepiped in . 3 cannot be built. In this case, the function (1) outputs a message which has to be specific about whether a parallelogram or a parallelepiped cannot be built, (2) it also outputs D-0, and the program terminates (the command return) **If the vectors are linearly independent, the function calculates the area or the volume, denoted D, and outputs one of the following messages with the value of D The area of the parallelogram is" (output the area D) of The volume of the parallelepiped is" (output the volume D) Hint: in order to display a correct message whether it is the area or the volume, you should keep a track on the number of columns of A and use a conditional statement. **Type the function areavol in your diary file *"Run the function D=aceavol(A) on each of the following matrices (a) A-randi(10,2,2) (b) A-fix(10*rand(3,3) (c) A=magic(3) (d) B-tandi!-10, 10], 2, 1): -[B, 2*B] (e) X-gadil-10, 101, 3, 1); Y = tandi([-10, 10], 3, 1); A [X, Y, X-Y] Notice: the matrices in (d) and (e) are created by using vectors

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

Students also viewed these Databases questions

Question

Describe the patterns of business communication.

Answered: 1 week ago

Question

3. Provide two explanations for the effects of mass media

Answered: 1 week ago