Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: apply non-integer power on column vector

Subject: apply non-integer power on column vector

From: Alfred Chua

Date: 19 Jul, 2008 19:54:02

Message: 1 of 2

Hi,
I am having a problem on how to solve the equation out.
Suppose i am having a column vector:-
s=[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=[1.933 ; -2.627] however
when i apply the following command s.^(3/5), it yields
s=[1.9332 ;-0.8116 + 2.4980i]. May i know what is the exact
command to be used to solve the problem.

Subject: apply non-integer power on column vector

From: Arthur G

Date: 19 Jul, 2008 21:55:05

Message: 2 of 2

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

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics