Computers and Technology

I am doing an assignment in MatLAB and I do not understand how to get the dist_AB value. I have tried using the norm command with inside the difference between A - B and the difference between the Frobenius form, but in each case the asnwer is not correct. I do not understand if I am using a wrong Matlab command or my math logic is wrong. Can someone help me? %To find the Euclidean distance between two vectors, find the 2-norm of the difference of
%those vectors. Enter column vectors u and v. Then use the norm() command to find d(u, v), storing
%it in dist_uv.
u = [4; 3]
v = [-4; -12]
two_norm_u = norm(u, 2)
two_norm_v = norm(v, 2)
dist_uv = norm(u - v)
%To find the distance between two matrices with respect to the Frobenius inner product,
%find the Frobenius norm of the difference of those matrices. Enter matrices A and B.
%Then use the norm() command to find d(A, B), storing it in dist_AB.
A = [3 -7 4 3; -2 4 -5 0]
B = [1 -7 2 5; 0 0 -5 2]
fro_A = norm(A, 'fro')
fro_B = norm(B, 'fro')
%Below are the variables used for the last requirement, each are wrong.
fro_difference = norm(fro_A - fro_B)
dist_AB = norm(A - B)

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 19:40, Dogtes9667
Consider the following generator matrix: g= (1 0 0 0 1 0 0 0 1 1 1 1 1 0 1 1 1 0) find all the codewords generated by this generator matrix. determine the number of errors that this code will detect. determine the number of errors that this code will correct. prove that a linear code's minimum weight is equivalent to its minimum distance. that is, where c is a linear code, dist(c) = wh(c)
Answers: 1
image
Computers and Technology, 22.06.2019 00:30, Angellbatton6763
At an open or uncontrolled intersection, yield if a. your road is paved and the crossroad is not b. the cross road is paved and yours is not c. you have two or more passengers in your vehicle d. you did not yield in the last intersection
Answers: 1
image
Computers and Technology, 22.06.2019 09:40, vanessacasillas452
In the lab, which of the following displayed a list of all installed services and included a description of the service, the current state, and whether the service started automatically or manually? a. the services manager b. the applications summary c. the recommended services d. list the safe services list
Answers: 2
image
Computers and Technology, 23.06.2019 11:00, swelch2010
Describe three characteristics of at-risk drivers. a. b. c. describe three characteristics of safe drivers. a. b. c. describe three driver errors that could cause a collision. a. b. c. how will this information affect you as a driver now and in the future? (2-3 sentences)
Answers: 2
Do you know the correct answer?
I am doing an assignment in MatLAB and I do not understand how to get the dist_AB value. I have trie...

Questions in other subjects:

Konu
Chemistry, 13.01.2021 18:50
Konu
Mathematics, 13.01.2021 18:50