Finding peaks inside an Array

I want to show my Peaks inside a plot.
findpeaks seems to be the only thing that can do this.
But unfortunatly I can't get it to work with arrays.
for i =1:15
[pk_Moment {:,i}, lk_Freq {:,i}] = findpeaks(FFT_Moment {1,i}(:,1), FFT_Freq {1,i}(1,:));
end
Can Anybody show me how it's done?

2 comentarios

KSSV
KSSV el 6 de Nov. de 2020
What error you get with the above?
MeitiLuk
MeitiLuk el 6 de Nov. de 2020
Invalid use of operator.

Iniciar sesión para comentar.

 Respuesta aceptada

Ameer Hamza
Ameer Hamza el 6 de Nov. de 2020
Editada: Ameer Hamza el 6 de Nov. de 2020
The left side should be like this
[pk_Moment{i}, lk_Freq{i}] = findpeaks(FFT_Moment {1,i}(:,1), FFT_Freq {1,i}(1,:));

4 comentarios

MeitiLuk
MeitiLuk el 6 de Nov. de 2020
Now I get this error
An array for multiple LHS assignment cannot contain expressions.
Ameer Hamza
Ameer Hamza el 6 de Nov. de 2020
Try removing the space on LHS of the assignment as shown in my updated answer.
MeitiLuk
MeitiLuk el 6 de Nov. de 2020
Yes now it worked
Thanks!
Ameer Hamza
Ameer Hamza el 6 de Nov. de 2020
I am glad to be of help!

Iniciar sesión para comentar.

Más respuestas (0)

Preguntada:

el 6 de Nov. de 2020

Comentada:

el 6 de Nov. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by