can you help me to vectorize this for loop
1 view (last 30 days)
Show older comments
final_y = gpuArray(fft_frame.*y2.*y3.*y4);
final_y(1,:) = []; % eliminating first energy row
loc =zeros(3,no_frame);
val = zeros(3,no_frame);
final_y=gather(final_y);
for i = 1:no_frame
[loc(:,i),val(:,i)] = pickpeak(final_y(:,i),3,1); % Top 3 peaks
end
1 Comment
Jan
on 31 Jan 2018
As long, as you do not mention, what the function pickpeak does, there is no chance to predict, if the function can be vectorized. It does not belong to Matlab's toolboxes, so it would be useful, if you mention, where you did get it from.
Answers (0)
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!