| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
p = nextpow2(A)
p = nextpow2(A) returns the smallest power of two that is greater than or equal to the absolute value of A. (That is, p that satisfies 2^p >= abs(A)).
This function is useful for optimizing FFT operations, which are most efficient when sequence length is an exact power of two.
If A is non-scalar, nextpow2 returns the smallest power of two greater than or equal to length(A).
For any integer n in the range from 513 to 1024, nextpow2(n) is 10.
For a 1-by-30 vector A, length(A) is 30 and nextpow2(A) is 5.
![]() | nextDirectory (Tiff) | nnz | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |