mirror of
https://bitbucket.org/Mattrixwv/octavefunctions.git
synced 2025-12-06 18:53:57 -05:00
Added check for the correct number of variables and added a few comments
This commit is contained in:
17
Bisection.m
17
Bisection.m
@@ -1,13 +1,20 @@
|
||||
function [xList,errorList] = Bisection (f, lowerValue, upperValue, allowError)
|
||||
function [xList,errorList] = Bisection(f, lowerValue, upperValue, allowError)
|
||||
%
|
||||
%Bisection(f, lowerValue, upperValue, allowError)
|
||||
%Uses the bisection method to find the possible answers to the root of the function f
|
||||
%
|
||||
|
||||
pkg load symbolic;
|
||||
warning('off','OctSymPy:sym:rationalapprox');
|
||||
%Setting necesary values for the function
|
||||
cnt = 1;
|
||||
%Check that the number of input variables is correct
|
||||
if(nargin ~= 4)
|
||||
error('That is not the correct number of arguments')
|
||||
end
|
||||
%A few necesary things before we begin
|
||||
pkg load symbolic;
|
||||
warning('off','OctSymPy:sym:rationalapprox');
|
||||
%Constant Variables
|
||||
maxItterations = 50;
|
||||
%Variables
|
||||
cnt = 1;
|
||||
errorValue = 1;
|
||||
currentValue = 0.0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user