Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The area of a parallelogram in ~2, built on non-parallel vectors v,, v, and the volume of a parallelepiped in , built on vectors v,,

image text in transcribed

The area of a parallelogram in ~2, built on non-parallel vectors v,, v, and the volume of a parallelepiped in , built on vectors v,, v2, v,, which do not lie in the same plane, is det A (or abs(det A)), where A-[v, v2] and A-[v, v2 v,], respectively. (See Section 3.3 of the textbook for details.) In this exercise, you will be given 2 vectors in ~2, v and v2, or 3 vectors in on which a parallelogram or parallelepiped, respectively, may or may not be built. v,, v,, and v 35 **Create a function in MATLAB: function D areayol(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) or "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-areaval(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,101, 2, 1); A-[B, 2*B] (e) X tandi([-10, 101, 3, 1); Y = randi([-10, 101, 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

Recommended Textbook for

Advances In Databases And Information Systems 25th European Conference Adbis 2021 Tartu Estonia August 24 26 2021 Proceedings Lncs 12843

Authors: Ladjel Bellatreche ,Marlon Dumas ,Panagiotis Karras ,Raimundas Matulevicius

1st Edition

3030824713, 978-3030824716

More Books

Students also viewed these Databases questions

Question

Explain the causes of indiscipline.

Answered: 1 week ago