diff options
Diffstat (limited to '60/DEPENDENCIES/regulfalsi.sce')
-rwxr-xr-x | 60/DEPENDENCIES/regulfalsi.sce | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/60/DEPENDENCIES/regulfalsi.sce b/60/DEPENDENCIES/regulfalsi.sce new file mode 100755 index 000000000..a743b4a4f --- /dev/null +++ b/60/DEPENDENCIES/regulfalsi.sce @@ -0,0 +1,13 @@ +function [x]=regularfalsi(a,b,f)
+ N=100;
+ PE=10^-5;
+ for n=2:1:N
+ x=a-(a-b)*f(a)/(f(a)-f(b));
+ disp(x)
+ if abs(f(x))<=PE then break;
+ elseif (f(a)*f(x)<0) then b=x;
+ else a=x;
+ end
+ end
+ disp(n," no. of ittirations =")
+endfunction
\ No newline at end of file |