function [M, K, w0] = real_data(design,m)

if design == 1
  n = 4;
  X = zeros(n,m);
  
  for i = 1:m
    s = 3*i/m;
    X(:,i) = [exp(-s),s*exp(-s),exp(-2*s),s*exp(-2*s)]';
  end
  
  M = zeros(n^2,m);
  for i = 1:m
    A = X(:,i)*X(:,i)';
    M(:,i) = reshape(A,n^2,1);
  end
  
elseif design == 2
  n = 4;
  X = zeros(n,m);
  
  for i=1:m
    s = 3*i/m;
    X(:,i) = [1 s s^2 s^3]';
  end
  
  M = zeros(n^2,m);
  for i = 1:m
    A = X(:,i)*X(:,i)';
    M(:,i) = reshape(A,n^2,1);
  end

elseif design == 3
  n = 5;
  k = m;
  m = m^2;
  M = zeros(n^2,m);
  
  for i = 1:k
    r = 2*i/k - 1;
    for j = 1:k
      s = j/k;
      u = [1; r; r^2; s; r*s];
      M(:,(i-1)*k+j) = reshape(u*u',n^2,1);
    end
  end
  
elseif design == 4
  n = 4;
  X = zeros(n,m);
  
  for i = 1:m
    s = i/m;
    X(:,i) = [s s^2 sin(2*pi*s) cos(2*pi*s)]';
  end
  
  M = zeros(n^2,m);
  for i = 1:m
    A = X(:,i)*X(:,i)';
    M(:,i) = reshape(A,n^2,1);
  end
  
end
k = n;
K = eye(k);

w0 = ones(m,1)/m;
