http://www.mathworks.com/matlabcentral/newsreader/view_thread/299461
MATLAB Central Newsreader  Root functions?
Feed for thread: Root functions?
enus
©19942015 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Wed, 22 Dec 2010 12:31:04 +0000
Root functions?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/299461#806810
Chris McCorquodale
Hi,<br>
<br>
I was wondering if anyone can tell me how to implement a "root" function in matlab. I know that the square root is simply sqrt(....) but what about fourth or fifth, negative roots etc?<br>
<br>
I am quite new to matlab so help here would be much appreciated,<br>
<br>
Chris

Wed, 22 Dec 2010 12:48:05 +0000
Re: Root functions?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/299461#806813
Grzegorz Knor
"Chris McCorquodale" wrote in message <iesr28$o1a$1@fred.mathworks.com>...<br>
> Hi,<br>
> <br>
> I was wondering if anyone can tell me how to implement a "root" function in matlab. I know that the square root is simply sqrt(....) but what about fourth or fifth, negative roots etc?<br>
> <br>
> I am quite new to matlab so help here would be much appreciated,<br>
> <br>
> Chris<br>
<br>
^  Matrix power. X^p is X to the power p, if p is a scalar. If p is an integer, the power is computed by repeated squaring. If the integer is negative, X is inverted first. For other values of p, the calculation involves eigenvalues and eigenvectors, such that if [V,D] = eig(X), then X^p = V*D.^p/V.<br>
<br>
<a href="http://www.mathworks.com/help/techdoc/ref/arithmeticoperators.html">http://www.mathworks.com/help/techdoc/ref/arithmeticoperators.html</a><br>
<br>
Grzegorz

Wed, 22 Dec 2010 13:31:22 +0000
Re: Root functions?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/299461#806822
Bruno Luong
"Chris McCorquodale" wrote in message <iesr28$o1a$1@fred.mathworks.com>...<br>
> Hi,<br>
> <br>
> I was wondering if anyone can tell me how to implement a "root" function in matlab. I know that the square root is simply sqrt(....) but what about fourth or fifth, negative roots etc?<br>
> <br>
> I am quite new to matlab so help here would be much appreciated,<br>
> <br>
> Chris<br>
<br>
fifth "root" of x:<br>
x.^(1/5)<br>
<br>
Bruno

Wed, 22 Dec 2010 14:05:08 +0000
Re: Root functions?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/299461#806829
Chris McCorquodale
Thank you both very much for your answer!<br>
<br>
Chris

Wed, 22 Dec 2010 14:07:05 +0000
Re: Root functions?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/299461#806832
Chris McCorquodale
"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <iesuj9$dm4$1@fred.mathworks.com>...<br>
> "Chris McCorquodale" wrote in message <iesr28$o1a$1@fred.mathworks.com>...<br>
> > Hi,<br>
> > <br>
> > I was wondering if anyone can tell me how to implement a "root" function in matlab. I know that the square root is simply sqrt(....) but what about fourth or fifth, negative roots etc?<br>
> > <br>
> > I am quite new to matlab so help here would be much appreciated,<br>
> > <br>
> > Chris<br>
> <br>
> fifth "root" of x:<br>
> x.^(1/5)<br>
> <br>
> Bruno<br>
<br>
Thanks you both very much for your answer!<br>
<br>
Chris

Wed, 22 Dec 2010 14:35:24 +0000
Re: Root functions?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/299461#806844
Matt J
"Chris McCorquodale" wrote in message <iesr28$o1a$1@fred.mathworks.com>...<br>
> Hi,<br>
> <br>
> I was wondering if anyone can tell me how to implement a "root" function in matlab. I know that the square root is simply sqrt(....) but what about fourth or fifth, negative roots etc?<br>
=======<br>
<br>
There's also the NTHROOT function, if you are interested in only real roots.