This is where navigation should be.


GSP_TWOSPIRALS - Generate "two spirals" dataset with N instances

Usage

gsp_twospirals(N, degrees, start, noise);
gsp_twospirals(N, degrees, start);
gsp_twospirals(N, degrees);
gsp_twospirals(N);
gsp_twospirals();

Description

Input arguments:
N : Number of points (default 2000) degrees : The length of the spirals in degree (default 570) start : how far from the origin the spirals start, in degrees (default 90) noise : Noise level (default 0.2)
Output arguments:
x : Position of the points y : label

Note that for noise=0, there is no noise and at noise=1 the spirals will start overlapping

This function is adaptated from: http://stackoverflow.com/questions/16146599/create-artificial-data-in-matlab and http://stackoverflow.com/questions/5837572/generate-a-random-point-within-a-circle-uniformly

Example:

[x,y] = gsp_twospirals();
figure();
plot(x(y>0,1),x(y>0,2),'xr');
hold on
plot(x(y<=0,1),x(y<=0,2),'ob');
hold off
gsp_twospirals_1_1.png