ghasem_008
Full Member level 4

hi.
I have a problem.
my matlab code is very compicated.I want to obtain zeros of a nonlinear equation that involved bessel functions.
I have to slove a coefficient determinant of 4*4.
in all of elements of this determinanT,i have a variable kz that should be specified.
first: i defined a "syms kz" and then wrote my matrix(A).for example:
sysms kz
A11=besselj(0,sqrt(kz^2-5));
second : I want to solve this 4*4 determinant with "fsolve command" in close of my guess.therefore convert symbolic function to handle function with "matlabFunction" command & wrote my new matrix (B).for example:
B11=matlabFunction(A11);
third : with "SAROS" command i found determinant of B matrix and named it :"det_total" .
note that my guess is given.
forth: i wrote "fsolve(det_total,my_guess)"
but i received below error message:
"If FUN is a MATLAB object, it must have an feval method."
Error in ==> mat_function2 at 68
kz(q)=fzero(det_total,my_guess);
how should solve this determinant with handle function.I konw fsolve can't work with symbolic functions.therefore i convert symbolic functions to handle functions with "matlabFunction" command.but yet i receive above error.
please help me.how should i treat?
I have a problem.
my matlab code is very compicated.I want to obtain zeros of a nonlinear equation that involved bessel functions.
I have to slove a coefficient determinant of 4*4.
in all of elements of this determinanT,i have a variable kz that should be specified.
first: i defined a "syms kz" and then wrote my matrix(A).for example:
sysms kz
A11=besselj(0,sqrt(kz^2-5));
second : I want to solve this 4*4 determinant with "fsolve command" in close of my guess.therefore convert symbolic function to handle function with "matlabFunction" command & wrote my new matrix (B).for example:
B11=matlabFunction(A11);
third : with "SAROS" command i found determinant of B matrix and named it :"det_total" .
note that my guess is given.
forth: i wrote "fsolve(det_total,my_guess)"
but i received below error message:
"If FUN is a MATLAB object, it must have an feval method."
Error in ==> mat_function2 at 68
kz(q)=fzero(det_total,my_guess);
how should solve this determinant with handle function.I konw fsolve can't work with symbolic functions.therefore i convert symbolic functions to handle functions with "matlabFunction" command.but yet i receive above error.
please help me.how should i treat?