[問題] 計算fcm分群的各群平均值已回收

看板MATLAB作者 (阿康)時間16年前 (2010/04/27 21:02), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
有一個 1050*800 的 [0,1] 矩陣, 將其轉換後以 matlab 內建的 fcm分群, a=(rand(1050,800)<=0.6); [i j]=find(z);[j i]; data=ans; [center,U,obj_fcn] = fcm(data, 4); maxU = max(U); index1 = find(U(1,:) == maxU); index2 = find(U(2,:) == maxU); index3 = find(U(3,:) == maxU); index4 = find(U(4,:) == maxU); line(data(index1,1),data(index1, 2),'linestyle','none',... 'marker','*','color','g'); line(data(index2,1),data(index2, 2),'linestyle','none',... 'marker','*','color','r'); line(data(index3,1),data(index3, 2),'linestyle','none',... 'marker','*','color','b'); line(data(index4,1),data(index4, 2),'linestyle','none',... 'marker','*','color','k'); 之後畫出來的圖長這樣: http://ppt.cc/NEoy 我目前只知道一個區域中有幾個點, 請問有沒有辦法能"大概"測出區域的面積, 因為我想計算各區的平均值. 謝謝大家. -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.114.53.222
文章代碼(AID): #1Brk1_DK (MATLAB)