fun = @(x,t)x(1)*t.^3 + x(2)*t +6;
x=lsqcurvefit(fun, x0, t, y);
fprintf('Function fitted is y = %5.3f x^3 + %5.3f x + 6\n', x(1), x(2));
fplot(@(t)x(1)*t.^3 + x(2)*t +6, [B(1,1) B(10,1)]);
The above is my code. The scatter command works as usual when I get rid of the fplot command, but fplot seems to overwrite the scatter part and does not show me the data points anymore.
Thanks in advance.