diff --git a/matlab/hendi_fit.m b/matlab/hendi_fit.m new file mode 100644 index 0000000..7d2b5da --- /dev/null +++ b/matlab/hendi_fit.m @@ -0,0 +1,35 @@ +## Copyright (C) 2019 Jens +## +## This program is free software: you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see +## . + +## -*- texinfo -*- +## @deftypefn {} {@var{retval} =} hendi_fit (@var{input1}, @var{input2}) +## +## @seealso{} +## @end deftypefn + +## Author: Jens +## Created: 2019-04-04 + +function p = hendi_fit (N) +x = [500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000,2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900, 3000, 3100, 3200, 3300, 3400, 3500]; +y = [4092, 3840, 3700, 3440, 3300, 3060, 3000, 2930, 2860, 2780, 2640, 2510, 2430, 2360, 2190, 2130, 2030, 1980, 1880, 1730, 1630, 1560, 1480, 1400, 1240, 1150, 1150, 1080, 920, 740, 670]; + +p = polyfit(x, y, N); +ys = polyval(p, x); + +plot(x, y, x, ys); grid; + +endfunction diff --git a/matlab/results_sprung.m b/matlab/results_sprung.m new file mode 100644 index 0000000..ff0c8f8 --- /dev/null +++ b/matlab/results_sprung.m @@ -0,0 +1,33 @@ +## Copyright (C) 2019 Jens +## +## This program is free software: you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see +## . + +## -*- texinfo -*- +## @deftypefn {} {@var{retval} =} results_sprung (@var{input1}, @var{input2}) +## +## @seealso{} +## @end deftypefn + +## Author: Jens +## Created: 2019-04-16 + +function results_sprung (filename) + x = load(filename); + Npad = 600; + t = [-(Npad-1:-1:0)/60 x(:,1)']; + v1 = [repmat(x(1,2), 1, Npad) x(:,2)']; + plot (t, v1); grid + +endfunction