Question: use matlab to solve this Write a function dist2means(X,M) which takes a matrix of data (X) and a matrix of means (M) and computes the

use matlab to solve this

Write a function dist2means(X,M) which takes a matrix of data (X) and a matrix of means (M) and computes the distance between row i (a vector) of X and row j (a vector) of M and stores it in entry (i,j) of the output. CHECK YOUR CODE: Copy Z=dist2means([1,5,2,3;7,23,8,1;0,8,3,7;1,7,4,8;2,7,3,2;0,0,4,7],[2,2,2,2;4,4,4,4;8,8,8,8]) into the command line. The result should be Z = 3.3166 3.8730 10.9087 22.4277 19.8746 16.5831 8.1240 6.4807 9.4868 8.1240 5.8310 8.1240 5.0990 4.2426 9.8995 6.0828 6.4031 12.0416

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!