can you help me to vectorize this for loop

1 view (last 30 days)
serena dsouza
serena dsouza on 30 Jan 2018
Commented: Jan on 31 Jan 2018
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
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.
It does not seem to be FEX: pickpeaks, because the 2nd input 3 would be illegal.

Sign in to comment.

Answers (0)

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!