can you help me to vectorize this for loop

8 vues (au cours des 30 derniers jours)
serena dsouza
serena dsouza le 30 Jan 2018
Commenté : Jan le 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 commentaire
Jan
Jan le 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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by