ghasem
Posts:
98
Registered:
4/13/13


Re: how solve this equation with one unknown?
Posted:
May 6, 2013 8:59 AM


> WHat correction? > > I can't run your code as you post it. > You should post complete, selft contained code that > runs. Make sure it is all in segment, clearly delimited > so someone who wants to copy it, knows where it starts > and where it ends. > > So, try again. Post complete working code, then > may be you'll have better chance of someone helping > you better. ======================================= ok,you right. my code (with correction) is as following: my code is : gr1 = sqrt(100  my_var^2); gr2 = sqrt(150  my_var^2); gr3 = sqrt(70  my_var^2); % matrix elements are: a11 = gr1.^2.*besseli(0,gr1); a12 = gr2.^2.*besseli(0,gr2); a13 = gr2.^2.*besselk(0,gr2); a14 = 0; a21 = gr1.*besseli(1,gr1); a22 = gr2.*besseli(1,gr2); a23 = gr2.*besselk(1,gr2); a24 = 0; a31 = 0; a32 = gr2.^2.*besseli(0,gr2); a33 = gr2.^2.*besselk(0,gr2); a34 = gr3.^2.*besselk(0,gr3); a41 = 0; a42 = gr2.*besseli(1,gr2); a43 = gr2.*besselk(1,gr2); a44 = gr3.*besselk(1,gr3); A_matrix = [a11 a12 a13 a14 ; a21 a22 a23 a24 ; a31 a32 a33 a34 ; a41 a42 a43 a44]; det_A = det(A_matrix); solving = fzero (det_A , guess);
I want to solve "det_A" to obtain "my_var" value.but I don't know how introduce "my_var" in gr1,gr2 and gr3,such that in "det_A", exist "my_var" as a variable. if I use from " syms my_var",therefore I can not use from fsolve. obviously,in the above,I get this error: ??? Undefined function or variable 'my_var'. how introduce "my_var" to matlab? ghasem

