(translator=Kuo, ChineseSource=Kuo-20020514-6\nextpow2.html, EnglishSource=c:\matlabr12\help\techdoc\ref\nextpow2.html)
MATLAB Function Reference    
nextpow2

接近二的次方的值

Syntax

Description

p = nextpow2(A) 傳回大於或等於 A 的絕對值中,最小的二的次方值 (即 p 滿足 2^p abs(A))。

這個函式用在 FFT 最佳化時很有用,因為當序列的長度恰為二的次方時運算最有效率。

若 A 不是純量, nextpow2會傳回大於或等於 length(A) 中最小的二的次方的值。

Examples

對於任意介於 513 到 1024 的整數 n, nextpow2(n) 等於 10。

對於一個 1-by-30 的向量 A, length(A) 為 30 且 nextpow2(A) 等於 5。

See Also

fft, log2, pow2


 newplot nnls