Re: solving an algebraic equations
"aravind bhimarasetty" <baravi.no.spam@xxxxxxxxxxx> wrote in message
<fsqmea$9v1$1@xxxxxxxxxxxxxxxxxx>...
I have this algebraic equation x = y + exp(y)
I would like to find y as a function of x. Can you please
suggest a numerical implementation in MATLAB to do this?
x = 2;
fun = @(y) y + exp(y) - x
y = fzero(fun,1)
y =
0.442854401002389
As a test, fun(y) should be reasonably close to zero.
fun(y)
ans =
0
John
.
Relevant Pages
- Re: Rounding problem with corrcoef() ?
... It seems that Matlab is not interpreting an ... operation that results in an answer of zero to be zero. ... Since all the values of x1 are the same, the correlation ... (comp.soft-sys.matlab) - Re: basic problem!
... set the values in x that are less than the mean to zero. ... greater than 3 to some value, I'll pick inf here ... Try this in matlab ... (comp.soft-sys.matlab) - Re: Problem with random variable generation
... However, if you try to numerically determine the expected value of Z^2, the result is equal to j*2*E, which demonstrates that MATLAB is only capable of generating improper random variables. ... If you drew one value from a standard normal distribution, would you expect that value to be exactly zero, simply because the mean of its distribution is zero? ... But you aren't computing theoretical means, you are computing a Monte-Carlo approximation, and those MC approximations are random variables and have a mean and variance of their own. ... ans = 0.0056569>> ans = ... (comp.soft-sys.matlab) - Re: error: Math script code giving only zeros..
... I wouldn't trust the answer in either Matlab or Labview. ... the values Matlab gave for M were equal to zero. ... (comp.lang.labview) - Re: zero based arrays?
... John D'Errico wrote: ... There is a very real and very 'physical' reason for zero based ... of this, but c came before Matlab, and in fact, Matlab is written in ... them, or else programming would never work, ever, at all. ... (comp.soft-sys.matlab) |
|