MATLAB: Zero-crossing of every column of a matrix

zero crossing

I have a 351×117 matrix. I need to compute the zero-crossing of every column of the matrix, in order to obtain the average max and min amplitude of every individual wave within each column.
I believe this would be a loop problem, or perhaps this might require a User-defined-function? Any help on how to get started?

Best Answer

If you want the maximum and minimum amplitudes (and you have R2017b or later releases), use the islocalmax and islocalmin funcitons. Also, if you have the Signal Processing Toolbox, you can use findpeaks on the original and negative (to find the minima) versions of your signal, however it requires a loop for matrices because it only handles vectors.
There is no need to find the zero-crossings then. (However if you still need to find them, doing so is relatively straightforward.)