could anyone help me to solve the issue
Show older comments
Input of the code are as given below:
N_UE=[6]%no of users
PPP =[ -0.0457 0.0814;
-0.1931 2.3985;
1.8712 1.2803;
-0.4831 1.0973;
1.5610 2.4849;
1.2560 1.2499]%x-coordinate and y-coordinate with respect to 6 users.
a=1
c =[1;
3;
2;
4;
1;
2]
centroids=4
cluster_colors = Columns 1 through 12
'm' 'g' 'y' 'b' 'r' 'c' 'k' '[.5 .6 .7]' '[.2 .3 .4]' '[.1 .2 .3]' '[.7 .8 .9]' '[.6 .4 .3]'
Columns 13 through 17
'[.4 .5 .6]' '[.7 .8 .9]' '[0.5 0 0]' '[0 0.5 0]' '[0 0 0.5]'
A =[3;
1;
1;
0;
3;
0]
with respect to the input I run the following code and got the graph.
code:
figure
plot(PPP(:,1),PPP(:,2),'k*')
hold on
for cc=1:centroids
plot(PPP(c(:,a)==cc,1),PPP(c(:,a)==cc,2),'o','color',cluster_colors{cc});
end
figure
plot(1:N_UE,A,'-*')
The first 1.jpg is correct
with respect to the 2.jpg the location of N_UE is correct.But all appears in same color
But it should have the different number of color as shown in 1.jpg.
Could anyone please help me on this.
1 Comment
Jan
on 28 Feb 2019
I've formatted your code today to make it readable. Please do this by your own in following questions. Thanks.
Accepted Answer
More Answers (0)
Categories
Find more on Image Filtering and Enhancement in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!