We are trying to find the roots of a function where exp(f(z)) = c. (where c is a complex number). Also f(z) is a polynomial function. The function will have the following format:(adsbygoogle = window.adsbygoogle || []).push({});

expsolve( [an an-1 …] , c ) where n is the degree of “z”.

For do this I took the natural logarithm of both sides and find f(z) = log(c). The code I have written so far is as follows;

function expsolve(v,c);

len=length(v)

temp=log(c);

syms z;

syms def;

syms first;

first=0;

for(a=1:len)

def=v(len-a+1)*(z^(a-1))

first=first+def

end

first

equ=first-log(c)

--------------------

now if I write expsolve([1 5 3], 4) for instance

until the first part it gives me the correct result (first=z^2+5*z+3)

however, I could not do the rest. how can I find the roots of first-log(c).

I tried to write different combination of :

solve('equ=0','z').

However, it gave my either an error or a illogical answer.

How can I proceed in this question. Besides the code I have written is there any simpler way to solve the question?

**Physics Forums - The Fusion of Science and Community**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# How to use solve function in matlab in this case

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

Loading...

Similar Threads for solve function matlab | Date |
---|---|

MATLAB Matlab Code for solving and plotting function x'(t) = 1 + t*sin(t*x) | May 9, 2013 |

How can i use the Solve function to find the actual equation for a | May 4, 2012 |

Matlab solve function in for loops | Nov 29, 2011 |

Matlab ODE45: solving with coefficients that are functions of time | Aug 5, 2011 |

Another Mathematica Question about Solve Function | Mar 17, 2009 |

**Physics Forums - The Fusion of Science and Community**