バイプロットで表示したデータの色分けを行う方法(biplot,pca)
显示 更早的评论
Matlab初心者です。
現在、データのクラスタリングを行い、得られた結果をPCAとバイプロットを用いて図示しようと悪戦苦闘しております。
下記の図にあるように,現在のコードでは全てのデータが赤色になってしまっています。
データをクラスターごとに色分けし,表示する方法がわかりません。
どうか知恵をお貸しいただけますでしょうか。
よろしくお願いいたします。
D=readmatrix("Test.xlsx");
[coeff,score,latent]=pca(D)
[idx,H,sumd]=kmeans(D,3,MaxIter=1000,Display="final",Replicates=5)
vbls = {'Depth','Sample','Ping','sea bottom mean','Length','Height','Perimeter','Area','BAmean','TAmean','Elongation','UNEVENNESS1','UNEVENNESS"','Lectangularity','Fractual demensiton','Circularity'};
figure
biplot(coeff(:,1:3),'scores',score(:,1:3),"VarLabels",vbls)
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 次元削減と特徴抽出 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!