Contents Previous Next Subchapters

Smallest Power of Two Greater or Equal a Specified Value
Syntax e = nextpow2(x)
See Also fft

Description
If x is a scalar, returns the smallest integer e such that
      e
     2   > | x | 
If x is a vector, returns
     nextpow2(length(x))
where length is the length of the vector x.

Example
If you enter
     nextpow2(10)
O-Matrix will reply
     4
If you enter
     nextpow2(.2)
O-Matrix will reply
     -2