# Finding the total number of zeros

4 views (last 30 days)
Commented: Benjamin Avants on 13 May 2014
I am trying to work out the time of flight from this excel data. This is a typical set of data that I have gained from a trial. The force plate was zeroed whilst the person was stood on the force plate hence the zeros at the start.
I am trying to find the set of zeros in a multiple number of excel spreadsheets for where they were in the air. However this data has multiple blocks of zeros and not all of these apply.
I have been told to use a find function to find the max value (the max value in this case would be a minus value due to force being exerted downwards) then 10N either side of this and then counting the zeros after this. However I do not think this will work as the max value is no where near the block of zeros.
Can anyone help?!
##### 2 CommentsShowHide 1 older comment
the only dimension that needs to be looked at is the Fz dimension (the last column) this normally signifies the person has jumped when it is zero, it will be very large minus numbers before this.
Yes it is just one jump, jumping off the force plate. I have multiple files of slightly different jumps all jumping off the force plate but all would have the same code just put into a loop.

Benjamin Avants on 13 May 2014
Looking through your sample data, this could be a little tricky.
I plotted the data and it looks like the jump takes place before the greatest magnitude of down force and that the time in the air is actually when the force plate has the highest positive values.
I would suggest using the max() function to find that value and then the find function to find all data points greater than the max - 10. The number of points found would be the time in the air, based on the instructions you mentioned in your post.
myMax = max(data(:,5));
vals = find(data(:,5) > (myMax - 10));
pointsInAir = numel(vals);
If you know how much time each data point represents, you can then calculate air time.
##### 2 CommentsShowHide 1 older comment
Benjamin Avants on 13 May 2014
The -10 is to account for the 10 N you mentioned in your question... I was assuming units were in Newtons.
I was also assuming your data is in a NumberOfFrames X 5 dimension array and that the last dimension was the data you were looking for. If the data is in a differently shaped array, you'll need to adjust the
data(:,5)
line so that it looks at the correct data.
ie. If your data is 5 X NumberOfFrames, the line should be
data(5,:)
The colon tells matlab to span all the entries in that dimension and the five is specifying the dimension that contains the data you care about.
If MATLAB imports your data as a single dimension variable (Fz for instance) then you need to replace
data(:,5)
with
Fz(:)