summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSerge Steer <serge.steer@scilab.org>2007-04-29 17:08:48 +0000
committerSerge Steer <serge.steer@scilab.org>2007-04-29 17:08:48 +0000
commit4e0fbf3dd30f17b91b5fdea319c581cfbacf3a04 (patch)
treeac89f4d98f390366bf54bed5970c1f15b573e444 /tests
parent1080457556b5da97599ad3af4689dcadaf614e95 (diff)
downloadscilab-4e0fbf3dd30f17b91b5fdea319c581cfbacf3a04.zip
scilab-4e0fbf3dd30f17b91b5fdea319c581cfbacf3a04.tar.gz
bug2330 added
Diffstat (limited to 'tests')
-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