Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!e39g2000hsf.googlegroups.com!not-for-mail
From: Arthur G <gorramfreak@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: apply non-integer power on column vector
Date: Sat, 19 Jul 2008 14:55:05 -0700 (PDT)
Organization: http://groups.google.com
Lines: 28
Message-ID: <b46f847e-a9f6-45ef-87cc-fd5cdcc0b242@e39g2000hsf.googlegroups.com>
References: <g5tgoq$3ti$1@fred.mathworks.com>
NNTP-Posting-Host: 98.217.207.130
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1216504505 16411 127.0.0.1 (19 Jul 2008 21:55:05 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sat, 19 Jul 2008 21:55:05 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: e39g2000hsf.googlegroups.com; posting-host=98.217.207.130; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Opera/9.51 (Macintosh; Intel Mac OS X; U; 
Xref: news.mathworks.com comp.soft-sys.matlab:480487



On Jul 19, 3:54=A0pm, "Alfred Chua" <alfred...@lycos.com> wrote:
> Hi,
> I am having a problem on how to solve the equation out.
> Suppose i am having a column vector:-
> s=3D[3;-5]
> when i attempt to apply non-integer power of 3/5 on the
> column vector, it is not able to obtain my desired result.
> the desired answer suppose to be s=3D[1.933 ; -2.627] however
> when i apply the following command s.^(3/5), it yields
> s=3D[1.9332 ;-0.8116 + 2.4980i]. May i know what is the exact
> command to be used to solve the problem.

=46rom the documentation for power:
"Note that for a negative value X and a non-integer value Y, if the
abs(Y) is less than one, the power function returns the complex roots.
To obtain the remaining real roots, use the nthroot function."

To obtain your desired result, combine "power" and "nthroot" as
follows:

>> nthroot([3;-5], 5).^3

ans =3D

    1.9332
   -2.6265

-Arthur