Skip to Main Content Skip to Search
Product Documentation

realpow - Array power for real-only output

Syntax

Z = realpow(X,Y)

Description

Z = realpow(X,Y) raises each element of array X to the power of its corresponding element in array Y. Arrays X and Y must be the same size. The range of realpow is the set of all real numbers, i.e., all elements of the output array Z must be real.

Examples

X = -2*ones(3,3)

X =
     -2     -2     -2
     -2     -2     -2
     -2     -2     -2

Y = pascal(3)

ans =
     1     1     1
     1     2     3
     1     3     6

realpow(X,Y)

ans =
    -2    -2    -2
    -2     4    -8
    -2    -8    64

See Also

Arithmetic Operator .^ | reallog | realsqrt

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS