From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Root functions?
Date: Wed, 22 Dec 2010 12:48:05 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 14
Message-ID: <iess25$s92$>
References: <iesr28$o1a$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1293022085 28962 (22 Dec 2010 12:48:05 GMT)
NNTP-Posting-Date: Wed, 22 Dec 2010 12:48:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1861624
Xref: comp.soft-sys.matlab:697517

"Chris McCorquodale" wrote in message <iesr28$o1a$>...
> Hi,
> 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?
> I am quite new to matlab so help here would be much appreciated,
> Chris

^ - 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.