Last active
May 15, 2017 23:25
-
-
Save Mebus/6ed6bbb9b3c1274c8a5a270c772123de to your computer and use it in GitHub Desktop.
Mechatronik Aufgabe 3.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Aufgabe 3.1 | |
y = transpose([5.5 1.5 -3.5 4.5 8.5]); | |
U = [-1.5 2.5;-0.5 0.25; 4.5 20.25; 7 49; 8 64]; | |
theta = inv((transpose(U)*U))*transpose(U) * y | |
y_schlange(1:5) = 0; | |
e = 0; | |
for j=1:5 | |
y_schlange(j) = theta(1) * U(j,1) + theta(2) * U(j,1)^2; | |
e = e + (y(j) - y_schlange(j))^2; | |
end | |
disp('y_schlange:'); | |
disp(y_schlange) | |
% Fehler bestimmen | |
e = 1/5*sqrt(e); | |
disp('e:'); | |
disp(e); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment