Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Making my code run to analyze different data
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!