To generate a for loop that will get the peak to peak amplitude of an m-wave signal, you need to perform the following steps:
main.m54 chars3 lines
main.m116 chars5 lines
The peak-to-peak amplitude is calculated by finding the maximum and minimum values of the signal up to the current index, i
, and subtracting them.
main.m91 chars5 lines
This will give you a graph of the peak-to-peak amplitude of the m-wave signal as a function of time.
Note: These steps assume that hmdata
is a matrix that contains the m-wave signal data in column 3. If your data is organized differently, you may need to adjust the code accordingly.
gistlibby LogSnag