git-svn-id: http://moon:8086/svn/projects/HendiControl@247 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
2019-04-16 05:52:29 +00:00
parent 3850b08a04
commit f3aae1bc9a
2 changed files with 68 additions and 0 deletions
+35
View File
@@ -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
## <https://www.gnu.org/licenses/>.
## -*- texinfo -*-
## @deftypefn {} {@var{retval} =} hendi_fit (@var{input1}, @var{input2})
##
## @seealso{}
## @end deftypefn
## Author: Jens <jens@orion>
## 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
+33
View File
@@ -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
## <https://www.gnu.org/licenses/>.
## -*- texinfo -*-
## @deftypefn {} {@var{retval} =} results_sprung (@var{input1}, @var{input2})
##
## @seealso{}
## @end deftypefn
## Author: Jens <jens@orion>
## 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