Path: news.mathworks.com!not-for-mail
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$1@fred.mathworks.com>
References: <iesr28$o1a$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1293022085 28962 172.30.248.35 (22 Dec 2010 12:48:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 22 Dec 2010 12:48:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1861624
Xref: news.mathworks.com comp.soft-sys.matlab:697517

"Chris McCorquodale" wrote in message <iesr28$o1a$1@fred.mathworks.com>...
> 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.

http://www.mathworks.com/help/techdoc/ref/arithmeticoperators.html

Grzegorz