📄 example1.m
字号:
% % Example1: % ---------% Shape: A Triangle % Dimension: 2% with outliersfunction [Samples, nof_samples, classification] = Example1()% The first sample is at (0.1,0.05)Samples = [0.1; 0.05];% Add more(99) samples randomly choosen from the [0,1] intervalfor i = 1:99 x = rand(2,1); % y must be larger then x to create the triangle while x(2) > x(1) x = rand(2,1); end Samples = [Samples x];end% Outliers:%add=[0.52 0.51 0.50 0.49 0.48 0.47 0.46 0.45 0.44 0.43 0.42 0.41 0.40 0.39 0.38; 0.48 0.49 0.50 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.60 0.62 0.63];add=[0.50 0.40 0.30 0.20 ; 0.50 0.60 0.70 0.80];Samples = [Samples, add];% Plotfigure;plot(Samples(1,:),Samples(2,:),'+');nof_samples = size(Samples,2);classification = zeros(nof_samples,1);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -