function [x, ynoisy, yclean] = noisydata(fun, xmin, xmax, np, rngseed)
    rng(rngseed);
    x = linspace(xmin, xmax, np);
    yclean = fun(x);
    noisestr = 0.1*max(abs(yclean));
    ynoisy = yclean + noisestr*randn(1, np);
end

%function y = fun(x)
%    a = 1.;
%    b = 1.;
%    c = 1.;
%    y = a*x + b*cos(x) + c*exp(-x);
%end
