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

Lala0099

### Lala0099 (view profile)

님이 질문을 제출함. 9 Mar 2019
최근 활동 Lala0099

### Lala0099 (view profile)

님이 댓글을 추가함. 13 Mar 2019
Image Analyst

### Image Analyst (view profile)

님이 답변을 채택함.
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

로그인 to comment.

## 답변 수: 1

Image Analyst

### Image Analyst (view profile)

님의 답변 9 Mar 2019
채택된 답변

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.

표시 이전 댓글 수: 6
Lala0099

### Lala0099 (view profile)

11 Mar 2019
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 (view profile)

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.
Lala0099

### Lala0099 (view profile)

13 Mar 2019
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);

로그인 to comment.

Translated by