summaryrefslogtreecommitdiffstats
path: root/tests/nonRegression/bug2330.sci
diff options
context:
space:
mode:
Diffstat (limited to 'tests/nonRegression/bug2330.sci')
-rw-r--r--tests/nonRegression/bug2330.sci28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/nonRegression/bug2330.sci b/tests/nonRegression/bug2330.sci
new file mode 100644
index 0000000..af4a96d
--- /dev/null
+++ b/tests/nonRegression/bug2330.sci
@@ -0,0 +1,28 @@
1// Non-regression test file for bug 2330
2// Serge Steer - Scilab Project
3// Copyright INRIA
4// 30 apr 2007
5
6mode(-1);
7clear;
8
9//build the data to fit
10//---------------------
11function Xcalc=biexp(p,t)
12 Xcalc=p(1).*exp(-p(2).*t)+p(3).*exp(-p(4).*t)+p(5);
13endfunction;
14t=(0:100:36000)';
15p=[0.1;0.0001;0.2;0.0002;0.3];
16X=biexp(p,t);
17
18//try to fit the data
19//-------------------
20//the error function
21function e=myerf(p,X,t),e=X-biexp(p,t),endfunction
22// the initial point
23p0=[0.01;0.001;0.01;0.001;0.1];
24//call datafit
25[pr,err]=datafit(list(myerf,t),X,p0);
26affich_result(err<5d-6,2330);
27clear
28