[regression] first part n-dim minimization

This commit is contained in:
2020-12-19 13:41:28 +01:00
parent 7518f9dd47
commit 891515caf8
2 changed files with 93 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
meansquarederrorline % generate data
meansquarederrorline; % generate data
c0 = 2.0;
eps = 0.0001;
@@ -21,9 +21,8 @@ hold on;
% generate x-values for plottig the fit:
xx = min(x):0.01:max(x);
yy = cest * xx.^3;
plot(xx, yy, 'displayname', 'fit');
plot(x, y, 'o', 'displayname', 'data'); % plot original data
plot(xx, yy);
plot(x, y, 'o'); % plot original data
xlabel('Size [m]');
ylabel('Weight [kg]');
legend("location", "northwest");
pause
legend('fit', 'data', 'location', 'northwest');