retrieving data and plotting it

조회 수: 1 (최근 30일)
FIR
FIR 2011년 11월 5일
I have 100*10 rows and column of data
col1 col2 A A A B B B C C
1 2 0.2 .3 .2 .1 .2 .69 .87 .8
2 3 0.2 0.8 .7 .5 .6 .9 .5 .8
2 4 0.2 .3 .2 .1 .2 .69 .87 .8
5 8 0.2 0.8 .7 .5 .6 .9 .5 .8
from this data i have found the highest accuracy for the for unique values in col1 and have plotted
the res for ex is
col1 clo2 acc
1 2 94
2 4 95
now for this data i have to find corresponging values from first data such as
col1 clo2 acc A A A B B B C C
1 2 94 0.2 .3 .2 .1 .2 .69 .87 .8
2 4 95 0.2 .3 .2 .1 .2 .69 .87 .8
FROM THIS DATA I WANT TO PLOT K MEANS,is it possible

채택된 답변

Andrei Bobrov
Andrei Bobrov 2011년 11월 5일
d = [ 1 2 0.2 .3 .2 .1 .2 .69 .87 .8
2 3 0.2 0.8 .7 .5 .6 .9 .5 .8
2 4 0.2 .3 .2 .1 .2 .69 .87 .8
5 8 0.2 0.8 .7 .5 .6 .9 .5 .8]
d1 = [ 1 2 94
2 4 95]
out = [d1, d(ismember(d(:,1:2),d1(:,1:2),'rows'),3:end)]
  댓글 수: 1
FIR
FIR 2011년 11월 5일
thank u andrei,as per your comment i got the output,i have such 100 rows and 10 column of data
i know to plot k means clustering,i need 100 k means graph for those 100 r0ws,(1 kmeans for 1 row)i thought of writing function and calling it back,even for that the programming lines becomes more
i have code for k means clustering
X is data of 1row and 10 columns
idx,ctrs] = kmeans(X,3,...
'Distance','city',...
'Replicates',5,...
'Options',opts);
plot(X(idx==1,1),X(idx==1,2),'r.','MarkerSize',14)
hold on
plot(X(idx==2,1),X(idx==2,2),'b.','MarkerSize',14)
plot(X(idx==3,1),X(idx==3,2),'g.','MarkerSize',14)
legend('DBLCL','FL','CLL')

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Bar Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by