summaryrefslogtreecommitdiff
path: root/macros/fminbnd.sci
diff options
context:
space:
mode:
Diffstat (limited to 'macros/fminbnd.sci')
-rw-r--r--macros/fminbnd.sci7
1 files changed, 7 insertions, 0 deletions
diff --git a/macros/fminbnd.sci b/macros/fminbnd.sci
index 2ebaa8c..c9bf4cc 100644
--- a/macros/fminbnd.sci
+++ b/macros/fminbnd.sci
@@ -153,6 +153,13 @@ function [xopt,fopt,exitflag,output,lambda] = fminbnd (varargin)
fun = varargin(1);
x1 = varargin(2);
x2 = varargin(3);
+
+
+ //To check whether the 1st Input argument (fun) is a function or not
+ if (type(fun) ~= 13 & type(fun) ~= 11) then
+ errmsg = msprintf(gettext("%s: Expected function for Objective (1st Parameter)"), "fmincon");
+ error(errmsg);
+ end
//Converting the User defined Objective function into Required form (Error Detectable)
function [y,check] = f(x)