Main Content

mpower, ^

Fixed-point matrix power (^)

Description

Y = A^k computes A to the k power for fi inputs and returns the result in Y.

The matrix power operation is performed using default fimath settings.

The fixed-point output array Y has the same local fimath as the input A. If A has no local fimath, the output Y also has no local fimath.

example

Y = mpower(A,k) is an alternate way to execute A^k.

example

Examples

collapse all

Compute the power of a 2-dimensional square matrix for exponent values 0, 1, 2, and 3.

x = fi([0 1; 2 4], 1, 32);
px0 = x^0 
px0 = 
     1     0
     0     1

          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Unsigned
            WordLength: 1
        FractionLength: 0
px1 = x^1 
px1 = 
     0     1
     2     4

          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Signed
            WordLength: 32
        FractionLength: 28
px2 = x^2
px2 = 
     2     4
     8    18

          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Signed
            WordLength: 65
        FractionLength: 56
px3 = x^3
px3 = 
     8    18
    36    80

          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Signed
            WordLength: 98
        FractionLength: 84

Input Arguments

collapse all

Base, specified as a scalar or matrix.

Example: x = fi([0 1; 2 4],1,32);

Data Types: fi
Complex Number Support: Yes

Exponent, specified as a real-valued integer.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fi

Extended Capabilities

Version History

Introduced in R2010a

See Also

| | |