Prev: Writing data into textfile
Next: Error message: Warning: Initializing Java preferences failed in matlabrc.
From: Giuseppe on 21 May 2010 11:35 the equation is like this solve('y*pi/b0=0.5*log((sqrt(a2+v^2)+v)/(sqrt(a2+v^2)-v))+2*gp/b0*atan(2*gp/b0*(v/sqrt(a2+v^2)))','v') 1. actually I have know the value of the coefficients in the equation, but how to transfer these value before the 'solve' command 2. It can't work out in matlab even if I syms y bo a2 gp in advance 3. if I replace the coefficients with values I could get the result of 'v', but unfortunately it is in a for loop, so I can't stop the program and write the value into the equation for each step Thanks!
From: Roger Stafford on 21 May 2010 13:48 "Giuseppe " <motognere(a)gmail.com> wrote in message <ht697p$l01$1(a)fred.mathworks.com>... > the equation is like this > > solve('y*pi/b0=0.5*log((sqrt(a2+v^2)+v)/(sqrt(a2+v^2)-v))+2*gp/b0*atan(2*gp/b0*(v/sqrt(a2+v^2)))','v') > > 1. actually I have know the value of the coefficients in the equation, but how to transfer these value before the 'solve' command > > 2. It can't work out in matlab even if I syms y bo a2 gp in advance > > 3. if I replace the coefficients with values I could get the result of 'v', but unfortunately it is in a for loop, so I can't stop the program and write the value into the equation for each step > > Thanks! Have you tried the 'subs' function? Roger Stafford
From: Walter Roberson on 21 May 2010 13:56 Giuseppe wrote: > the equation is like this > > solve('y*pi/b0=0.5*log((sqrt(a2+v^2)+v)/(sqrt(a2+v^2)-v))+2*gp/b0*atan(2*gp/b0*(v/sqrt(a2+v^2)))','v') > > > 1. actually I have know the value of the coefficients in the equation, > but how to transfer these value before the 'solve' command subs()
From: Steven Lord on 21 May 2010 15:05
"Giuseppe " <motognere(a)gmail.com> wrote in message news:ht697p$l01$1(a)fred.mathworks.com... > the equation is like this > > solve('y*pi/b0=0.5*log((sqrt(a2+v^2)+v)/(sqrt(a2+v^2)-v))+2*gp/b0*atan(2*gp/b0*(v/sqrt(a2+v^2)))','v') > > 1. actually I have know the value of the coefficients in the equation, but > how to transfer these value before the 'solve' command Then don't pass your equation in as a string. Pass it in as a symbolic expression: % define appropriate symbolic and/or numeric variables above S = solve(0.5*log((sqrt(a2+v^2)+v)/(sqrt(a2+v^2)-v))+2*gp/b0*atan(2*gp/b0*(v/sqrt(a2+v^2)))-y*pi/b0) -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com |