Question: Finish the matlab function to implement k means below, where X in the parameters is random data imported from a .dat file, idx is data

Finish the matlab function to implement k means below, where X in the parameters is random data imported from a .dat file, idx is data points assigned to nearest centroid, k = 5. The function updateCentroids should re-compute the cluster centroids by using the mean of all the data points in each cluster and assign the calculated mean as new centroid of the cluster.:

Finish the matlab function to implement k means below, where X in

function centroids = updateCentroids (X, idx, K) [m n] = size(X); centroids = zeros (K, n); for i=1:6 % you code here end function centroids = updateCentroids (X, idx, K) [m n] = size(X); centroids = zeros (K, n); for i=1:6 % you code here end

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!