Finding the total number of zeros

11 vues (au cours des 30 derniers jours)
Adrienne
Adrienne le 13 Mai 2014
Commenté : Benjamin Avants le 13 Mai 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 commentaires
Benjamin Avants
Benjamin Avants le 13 Mai 2014
Can you explain a little more about what each dimension of the data is signifying?
Also, are these trials of a person jumping up off of a force plate? If so, is it just one jump? Clarify a little and I'll help you figure out what you need to do.
Adrienne
Adrienne le 13 Mai 2014
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.

Connectez-vous pour commenter.

Réponse acceptée

Benjamin Avants
Benjamin Avants le 13 Mai 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 commentaires
Adrienne
Adrienne le 13 Mai 2014
I encompassed this answer and added the end on to calc. air time: myMax=max(data(:,5)); vals=find(data(:,5)>(myMax - 10)); tnf=numel(vals); tof(i)=tnf*fps; %Time of flight is equal to this %tnf=total number of frames equal to zero; %tnf means total number of frames jh=((g*(tof^2))/8); %defining jump height
however it says: Index exceeds matrix dimensions. error in the mymax line. I do not understand what that means, I understand about the force trace, I plotted it too and understand the jump happened before the biggest max force, but I do not understand why you have put the -10? what does this do?
Benjamin Avants
Benjamin Avants le 13 Mai 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(:)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Data Import from MATLAB dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by