Question: use matlab to do this Step 1: Run the following code (already inserted below). load fisheriris.mat; X=meas; K=3; n=150; p=randperm(n); means=X(p(1:3),:); What the variables are:

use matlab to do this

Step 1: Run the following code (already inserted below). load fisheriris.mat; X=meas; K=3; n=150; p=randperm(n); means=X(p(1:3),:); What the variables are: X is the original data k is the number of groups or clusters n is the number of data points (number of flowers that were measured) p takes the orginal data and reorders it randomly means take 3 data points and sets them to the mean about which we will define the groups Step 2: Now that your means and data are set up, use your previous functions to assign your data points in X to one of the k=3 groups. Step 3: Now you need to recalculate means for each group. Once you recalculate the means, compute distances and reassign groups. (Hint: sum(X(find(groups==1),:))/length(find(groups==1)) will calculate the mean for group 1. Note: groups is the output when you called assignGroup) Step 4: In a new figure, plot group 1 as red + signs, group 2 as blue x's and group 3 as green circles using the plot3 command and singling out groups similar to step 3's hint. Repeat step 3 and 4. Use view(160,50) (after the plot3 command) with your plots to see the data nicely. Step 5: Repeat steps 2 and 3 fifteen times. Then apply step 4 to see the results. Note: This problem should have three plot3 commands for each figure output to the screen. Make use of the hold on command.

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!