MATLAB-在一个区域内生成一个cluster

image

clc,clear all,close all
MU1 = [-0.25 -1];
SIGMA1 = [0.04 0; 0 0.04];
MU2 = [0.25 1];
SIGMA2 = [0.04 0; 0 0.04];
MU3 = [-1 0.25];
SIGMA3 = [0.04 0; 0 0.04];
MU4 = [1 -0.25];
SIGMA4 = [0.04 0; 0 0.04];
X = [mvnrnd(MU1,SIGMA1,300);mvnrnd(MU2,SIGMA2,300)];
Y = [mvnrnd(MU3,SIGMA3,300);mvnrnd(MU4,SIGMA4,300)];
scatter(Y(:,1),Y(:,2),10,'.')
hold on
scatter(X(:,1),X(:,2),10,'.')
xlim([-1.5 1.5])
ylim([-1.5 1.5])
xlabel('同相幅度')
ylabel('正交幅度')
title('散点图')
posted @ 2022-05-22 21:23  司砚章  阅读(102)  评论(0编辑  收藏  举报