function [train_in, train_out, test_in, true_out] = make_data(mag, freq, noise)
%
% ---- Preconditions ---- 
% MAG: The magnitude of the sine wave
% FREQ: The magnitude of the sine wave
% NOISE: The standard deviation of the noise added to the training data.
% 
% ---- Postconditions ----
% TRAIN_IN: a set of 10 points from the range 
% TRAIN_OUT: the values at those points plus noise
% TEST_IN: a set of 300 points from the range (useful for testing)
% TRAIN_OUT: the values at those points (no noise)
%
% ----- Description -----
% Generates data from a sine wave...
%
% function [train_in train_out test_in true_out] = make_sine_data(mag, freq)

% Construct training data
train_in = [1:10]'/10;
train_out =  0.5 + mag * sin(freq * pi * train_in) + noise * randn(size(train_in));
train_in = train_in * 50;

% construct a test set
test_in = [1:50]'/50;
true_out = 0.5 + mag * sin(freq * pi * test_in);
test_in = test_in * 50;

