From: Smitha Anjali on
I am super new to MATLAB. I have huge chunks of data and I would like to to find out the amount of time a particular data value is above or below 0 . I want to count the total time when my value on the y axis is above or below zero as percentage of total time.
Even a histogram showing the amount of time the data value is non zero would help.
From: Walter Roberson on
Smitha Anjali wrote:
> I am super new to MATLAB. I have huge chunks of data and I would like to
> to find out the amount of time a particular data value is above or below
> 0 . I want to count the total time when my value on the y axis is above
> or below zero as percentage of total time.
> Even a histogram showing the amount of time the data value is non zero
> would help.

NegativePercentage = sum(y(:) < 0) / numel(y) * 100