Question

Let the two vectors x & y and the matrix z be defined as follows 1.2 2.2 4.1 x-| 2.21, y-| 1.51,2-12.1-3.2 1.9 3.1 1.2 3.2 0.35 Write a script in Matlab and save it as .m file with name HW19_2. The script will execute the following tasks 1 Enter the vectors x &y and the Matrix z into the script. 2- Evaluate L2 lx2 3- Evaluate L1xl1 4- Evaluate Linf- l 5- Evaluate the dot product N-(x,y) 6- evaluated the angle in degrees between the vectors x & y 7- Evaluate M2 lzll2 8- Evaluate M1=111 9 Evaluate Minf zl

0 0
Add a comment Improve this question Transcribed image text
Answer #1

the matlab code for the problem is as follows:

clc; close all; clear all; x - [1;2.2;-1.35] y-[-2.4;1.5;0.35] z [-1.2 2.2 4.1; 2.1-3.2 1.9,3.1 1.2 3.2] L2 norm(x,2) L1 = norm(x,1) Linf = norm(x, inf) CosTheta -dot(x,y)/(norm(x)*norm(y)); ThetaInDegreesacosd (CosTheta); M2norm(z,2) M1norm(z,1) Minf = norm(z, inf)

the output from the command window after running the above code is

Add a comment
Know the answer?
Add Answer to:
Let the two vectors x & y and the matrix z be defined as follows 1.2...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT