Convert Equation to matlab

조회 수: 5(최근 30일)
chris pamp
chris pamp 2022년 9월 7일
편집: William Rose 2022년 9월 8일
Hello i want to convert this equation (see the attached image) to matlab commands.
  댓글 수: 5
Torsten 2022년 9월 7일
How to get ACCL_AP, ACCL_ML from the data ? What does the double decimal annotation mean? The time in column 1 seems to be constant.

댓글을 달려면 로그인하십시오.


William Rose
William Rose 2022년 9월 7일
This is motion capture or force plate data. AP, anterior-posterior. ML, medial-lateral. The jerk is numerically integrated over a fixed interval. acc=1+randn(100,2); %2 columns of simul WCCSP data %col 1=AP, col 2=ML dT=0.01; %sampling interval=.01 in this example jk=diff(acc)/dT; %instantaneous jerk
Sorry, can’t finish now, and not good typing on a phone. More later.
  댓글 수: 1
William Rose
William Rose 2022년 9월 8일
편집: William Rose 2022년 9월 8일
[edit: correct typos in the text; code is unchanged]
The equation figure which you posted appears in Mancini et al 2012 and in Mancini et al 2010. This measure was proposed 25 years before that by Flash & Hogan 1985.
I assume you will integrate for the duration of your sway trial, as Mancini et al did. Flash & Hogan integrated from t=0 to t=end of a defined movement task. Mancini et al do not specify t (upper limit of integration). They used 2 minute sway trials, so I assume they integrated from t=0 to 120 seconds.
First let us create some simulated acceleration (AP and ML) data. The mean value of acceleration = 1 in this simulation, for AP (column 1) and for ML (column 2). You will use your own data.
acc=1+0.1*randn(100,2); %simulated acceleration (m/s^2) col 1=AP, col 2=ML
dT=0.01; %sampling interval (s)
jerk=0.5*sum(diff(acc(:,1)/dT).^2+diff(acc(:,2)/dT).^2); %jerk
fprintf('Jerk = %.1f m^2/s^5.\n',jerk);
Jerk = 20052.2 m^2/s^5.
In the code above, diff(acc(:,1)/dT) is the time derivative of AP accel., and diff(acc(:,2)/dT) is the time derivative of ML accel. Each one is then squared and the results are summed. Then they are multiplied by 0.5.
I am not a fan of the jerk measure as defined by Mancini et al. I would have normalized it by the integration time. Without such normalization, the value scales linearly with test duration. Test duration does not give insight into the subject's motor control, so why so define a measure that scales with test duration? I realize that if you use the same test duration in all your subjects, then you can use it to compare subjects. But it makes it difficult to compare results across different reearch groups or projects - or impossible if the integration time is not specified clearly, and it is not, in the Mancini papers.
Mancini et al should not have called it jerk. Jerk is well defined as the derivative of acceleration. Its MKS units are m/s^3. It is a vector, like acceleration. Flash & Hogan did not call their quantity jerk, because they knew better. It is the time integral of the squared magnitude of jerk. Its MKS units are m^2/s^5. It is a scalar. It is clearly not jerk.
Try the code above, modified to suit your data. Good luck with your work.

댓글을 달려면 로그인하십시오.


Find more on Cardiology in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by