How to extract and plot only minimal and maximal peaks of an array , -graph analysis- With Matlab or excel

后端 未结 3 1191
礼貌的吻别
礼貌的吻别 2020-12-11 18:16

I\'m doing video analysis.
The end result array I get is something like:

signal =

    Columns 1 through 7

       73960       73960       73960       73         


        
3条回答
  •  一生所求
    2020-12-11 18:39

    I would just write a simple loop over the array in Matlab to achieve this. I don't see any fundamental problems there?

    If you don't want loops in Matlab, you can do it with some array operations. If you have two equallly long arrays a and b, you can do something like c = a>b, which gives you a list with ones and zeros. You1 can use this as a oneliner for selecting the maxima/minima. Zo suppose you have an upshifted and downshifted array b, c. Such that (except at endpoints) b(n-1)=a(n)=c(n+1). You can get an array containing only the extrema and zeros by q=a.*( (a>b).*(a>c) + (a

    One advise: If you signal has noise, than also this selection will be noisy. To smoothen the function, you should apply some kind of moving averaging with a kernel you like.

提交回复
热议问题