バイプロットで表示したデータの色分けを行う方法(biplot,pca)
Show older comments
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)
Accepted Answer
More Answers (0)
Categories
Find more on 次元削減と特徴抽出 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!