clear all
i=1;j=1;
for t=1:0.1:10,
    y(i) = 3*t;
    i=i+1;
end
for a=0:.001:5,
    i=1;
    for t=1:0.1:10,
        ye(i) = a*t;
        i=i+1;
    end
    J(j)=norm(y-ye)^2;
    p(j)=a;
    j=j+1;
end
plot(p,J),legend('y = 3 f and model: yest(x) = x f'),
xlabel('parameter x'), ylabel(' ||y - yest(x)||^2 ')
