分類器アプリ内の散布図を自分で作る方法を教えてください
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
分類器アプリ内の「散布図」を自分でも作りたのですが,やり方がわかりません.
データは分類器へインポートする形です.
応答子は3種類あります.応答子ごとに色を変えて2つの変数を散布図で表す方法を教えてください.
ファイル添付しております.
よろしくお願いします.
2 commentaires
Réponses (1)
Hiro Yoshino
le 20 Fév 2024
scatter 関数かなと思いますが、いかがでしょうか?:
a = rand(20,2);
b = rand(20,2);
scatter(a(:,1),a(:,2));
hold on
scatter(b(:,1),b(:,2));
legend("a","b");
6 commentaires
交感神経優位なあかべぇ
le 22 Fév 2024
forループを使用して、ラベル毎に分けた散布図を作成してみました。
load('tabledata.mat');
labels = unique(x.Label); %使用されているラベルの一覧を作成
figure;
for i = 1 : length(labels)
data = x(x.Label == labels(i), :); % テーブルデータから選択したラベルを持つデータを抽出
scatter(data.Av_Ave, data.Av_AveCross, 'DisplayName', labels(i)); % 散布図作成
hold on;
end
legend;
Voir également
Catégories
En savoir plus sur Scatter Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!