Dear MatLab users,
As beginner of MatLab, I am facing an issue that I cannot solve alone. I am using "findpeaks" as code to extract the number of peaks and the corresponding width (halfheight) of a data array. The code (very simple) is the following:
importdata('...\data.dat');x=ans(:,1);for i=[2:47] [pks,locs,widths,proms] = findpeaks(ans(:,i),x,'MinPeakProminence',40,'Annotate','extents','WidthReference','halfheight'); widthsend
However the code only stores the last result (width), while I would like that the code stored all the results for each y coordinate, that is 'ans(:,i)'.
Any advise would be really helpful.
Thanks.
Paolo
Best Answer