I am dealing with the following code:
function opemployment=eqns(unknown);
global kappa varphi lgamma beta r delta s x b e theta v;
h=unknown(1);
gamma=unknown(2);
opemployment(1)=(h^(gamma-1))*((1-kappa)*((lgamma*(varphi^beta))/(gamma*kappa*beta+1-kappa))*h^(gamma*beta-gamma)-(r+delta+s)*(s^(gamma-1))*x^(-gamma));
opemployment(2)=(1-kappa)*(b-e+(kappa/(1-kappa))*theta*v^(gamma-1));
and then call:
close all; clear all;
global kappa varphi lgamma beta r delta s x b e theta v;
kappa = 0.1;
varphi = 2;
lgamma = 3;
beta = 0.9;
r = 2;
delta = 2 ;
s = 3;
x = 5;
b = 4;
e =3;
theta = 3 ;
v = 2;
guess = [0.7,0.3];
sol=fsolve('eqns',guess)
Yet, I receive the following error: 'Error using feval Undefined function 'eqns' for input arguments of type 'double'.
Error in fsolve (line 217)
fuser = feval(funfcn{3},x,varargin{:});
Caused by:
Failure in initial user-supplied objective function evaluation.
FSOLVE cannot continue.
I am a total MATLAB beginner and have no clue where the error lays.