npow2

From STX Wiki
< Programmer Guide‎ | Command Reference‎ | EVAL
Revision as of 15:12, 6 April 2011 by Toni (talk | contribs) (Created page with '{{DISPLAYTITLE:{{SUBPAGENAME}}}} Compute the next power of 2. ;Usage: '''npow2(<var>x</var>)</code>''' :;<var>x</var>: a scalar, vector or matrix ;Result: If ''x'' is a scalar, t…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Compute the next power of 2.

Usage
npow2(x)
x
a scalar, vector or matrix
Result
If x is a scalar, the result r is the integer number N, which is the smallest value with N=2M (M is an integer greater/equal 0) and N>=x.
If x is a vector or a matrix, the function returns npow2(nrow(x)).
See also
fft, ifft

Example:

#n := eval npow2(1000)
// #n = 1024 = 2^10

<function list>

Navigation menu

Personal tools