Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Making my code run to analyze different data

2 ビュー (過去 30 日間)
Brady Wayne Robinson
Brady Wayne Robinson 2018 年 10 月 25 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Below you can see my code to analyze a huge set of data. That data is the left hip angle. The code that is posted is looking at the angles in the first column only. I need to change the code so that it takes the data from 1,10,and 25 column row 1-153. Other than that the code is the same. I just cannot get it to run and need help. Thank You so much! clc clear all M = dlmread('LeftHipAngle.txt','\t',4,1); x = M(:,1)*pi/180; rate = 120; xfindex = max(find(x)); for i = 1:xfindex time(i) = 1/rate*i; theta(i) = x(i); end
for i = 2:( xfindex - 1 ) tadj1( i - 1 ) = time( i ); cdiff( i - 1 ) = ( theta( i + 1 ) - ... theta( i - 1 ) ) / ( 2 * 1 / rate ); end
for i = 1:( xfindex - 2 ) tadj2( i ) = time( i ); onesider( i ) = ( -3 * theta( i ) + ... 4 * theta( i + 1 ) - theta( i + 2 ) ) / ... ( 2 * 1 / rate ); end plot(time, theta) xlim([0 max(time)]) grid on hold on plot(tadj1, cdiff, 'r--') hold on plot(tadj2, onesider, 'g-.') xlabel('Time, t (s)') title('Figure 1: Biomechanics Research') legend('Angular Position, \theta (rad)', ... 'Centered Diff. Angular Velocity, \omega_1 (rad/s)', ... 'One-Sided Diff. Angular Velocity, \omega_2 (rad/s)')
  1 件のコメント
madhan ravi
madhan ravi 2018 年 10 月 27 日
Upload the text file

回答 (0 件)

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by