commit | 7ca4571785052f797b3e09561a616064ef7699ca | [log] [tgz] |
---|---|---|
author | avm99963 <me@avm99963.com> | Sat Jan 30 19:54:32 2021 +0100 |
committer | avm99963 <me@avm99963.com> | Sat Jan 30 19:54:32 2021 +0100 |
tree | 9ff911e4a1056ff9443cea982d8eee3e17a4cba4 | |
parent | 3358606a80bf5ca3047db49ba7dec04372800d47 [diff] [blame] |
Add lab session 7 Handed in on Jan 24. Change-Id: I9e804d3f114e175887847cc737ad71d316081a45
diff --git a/p7/numericalintegration/main2.m b/p7/numericalintegration/main2.m new file mode 100644 index 0000000..b4ff19f --- /dev/null +++ b/p7/numericalintegration/main2.m
@@ -0,0 +1,12 @@ +M = dlmread('../data/escalfant_integration.dat'); + +d = @(t) (4.053e-08*t^2 + 9.445e-06*t + 5.368e-01); + +x = M(:, 1); +y = M(:, 2); + +for i = 1:size(y, 1) + y(i) = y(i) - d(x(i)); +end + +trapz(x, y)