function [x,y] = generate_data(n); % generates n uniformly distributed points x in the range [-1,1]x[-1,1] and % assigns them label y=1 if their distance to the center is smaller than % 0.3, or label y=-1 otherwise. % from T. Svoboda et al. (2008) x = 2*rand(2,n) - 1; y = 1 - 2*( sqrt(x(1,:).^2+x(2,:).^2) > 0.3 );