How can I determine the start and end of a movement?

Hello Everyone, I am trying to determine the beginning and the end of a movement , using matlab. So I have as ensr, that I used to collect data for specific movement. But before the actual movement, there is some time, where I the actual movement is not present yet, but the waiting position.
How can I get rid of that ? Any algorithm to find the start and end of a movement?
I would be greateful for any help

 Risposta accettata

Just crop it off starting at some index:
signal = signal(index:end)
To find out what index is, we'd need to know your signal, and your movement signal (if they're different signals). Attach it/them in a .mat file with the paper clip icon.

9 Commenti

Hey, thank you for your answer. I am attaching the data to this comment. Thank you for helping me
What do the columns represent? Which column is the movement number, and which is the signal you want to crop based on the movement signal?
The coloumns represent the following: coloumn1 - Time, Coloumn 2 - acceleration in X direction. Coloumn2- acceleration in Y direction. Coloumn 3 - acceleration in Z direction. Coloumn 4 - Xdirection(position), Coloumn 5 -Y dir. , coloumn 6 - z dir.
There is only one single movement, that is represented by those coloumns ( direction )
I need to crop off the values i dont need in all the coloumns.
Did I answer your question?
Thank you for helping me.
I've done this before for an instrument. Give me some time today to see if I can adapt it to your data.
Okay, Thank you very much!
See if the attached file works for you. I get a starting point for each of the 6 curves. You might want to get just one by taking the average of them, or taking the latest one or whatever.
0001 Screenshot.png
Thank you so much!
there is one bit that i really dont get.
Why are those both defined by 't'?
isnt the second line oerrites the first one?
t = data(:, 1);
t = 1 : length(z);
Image Analyst
Image Analyst il 11 Mar 2019
Modificato: Image Analyst il 11 Mar 2019
You can use the first one if you want. I just used the second one because when I was debugging it, it was easier to see where I was on the x axis when I used the index instead of the time.
You might also look at the findchangepts() function.
Image Analyst,
I found a problem with the code. It does not use certain lines within the function, hence does not find timePoint3.
I cannot find the reason why it cannot execute those lines.
Could you have a look?
[maxDeviation, timePoint3] = max(meanDeviationFromMean);

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by