Problem 1441. Convolution Power
Create the convolution-power vector from initial vector x and power n. In other words, similar to the scalar case, raising to the n-th power means repeating the convolution on itself n times.
Assume that n is a non-negative integer and x is a row vector.
Examples:
convpower(1:5,0)
ans =
1 convpower(1:5,1)
ans =
1 2 3 4 5 convpower(1:5,2)
ans =
1 4 10 20 35 44 46 40 25Neither string operations nor interpolations are allowed!
Solution Stats
Problem Comments
-
1 Comment
Muthu Annamalai
on 23 Apr 2013
Unfortunately the FFT based solution using a binary expansion of 'n' won't be Cody-optimal :-)
Solution Comments
Show commentsProblem Recent Solvers53
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15768 Solvers
-
514 Solvers
-
Back to basics 9 - Indexed References
459 Solvers
-
Volume of a sphere given its surface area
153 Solvers
-
Put Two 1D matrices into one 1D matrix
140 Solvers
More from this Author18
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!