Advanced MATLAB modeling

With Nexus 2.2, to simplify biomechanical modeling, additional MATLAB scripts are available in the Nexus SDK.

Classes that represent trajectories (read from Nexus or created as modeled markers), body segments, and angle outputs have been included to ease modeling of biomechanics based on Nexus data.

Sample functions include:

     Calculating the angles between two segments (as fixed, Euler or helical angles)

% Calculate the angle between two segments.

% Can choose euler, fixed or helical angle.

% Specify order of output angles for fixed and euler.

  LKneeAnglesEulerML = AngleBetween( LThigh, LShank, 'euler', 'yxz' );

 LKneeAnglesEulerML.Create( vicon );

  LKneeAnglesEulerML.Write( vicon );  

 

  LKneeAnglesFixedML = AngleBetween( LThigh, LShank, 'fixed' );

 LKneeAnglesFixedML.Create( vicon );

  LKneeAnglesFixedML.Write( vicon );  

 

  LKneeAnglesHelicalML = AngleBetween( LThigh, LShank, 'helical' );

 LKneeAnglesHelicalML.Create( vicon );

 LKneeAnglesHelicalML.Write( vicon );

     Creating modeled markers based on existing trajectory data

% Create a trajectory from the segment origin

  LThighPosML = NexusTrajectory( 'Colin' );

 LThighPosML.SetPosition( LThigh.Position() );

 LThighPosML.Create( vicon );

 LThighPosML.Write( vicon );

     Translating points in the coordinate system of existing segments

% Create a global trajectory that is offset by (100,0,0) in the

% segment coordinate system

 Offset = NexusTrajectory('Colin');

 Offset.SetPosition( [100;0;0] );

  TestTranslateML = LKNE + Offset*LThigh - LThigh.Position(); %TestTranslateML = LThigh.TranslatePointInSegment( LKNE, [100; 0; 0 ] );

 TestTranslateML.Create( vicon );

  TestTranslateML.Write( vicon );