ApplyProfileToModel:
% Apply a profile struct to a CAD model for display purposes.
Puts the q, axis, and angle fields in the appropriate fields in g.
g can then be passed into display functions like DrawSCPlanPlugIn.
--------------------------------------------------------------------------
Form:
g = ApplyProfileToModel( g, p, k )
--------------------------------------------------------------------------
------
Inputs:
------
g (:) CAD model
p (:) Profile structure with state fields
.q (4,:) ECI to body quaternion
.r (3,:) ECI position vectors
.v (3,:) ECI velocities
.jD (1,:) Julian dates
.rPlanetH (3,:) Vector to planet in heliocentric frame
.angle (n,:) Angles (initialized empty)
.axis (3,n) Axes for angles (empty)
.body (1,n) Body hinge for angle (empty)
k (1,1) Index to profile elements, if needed
--------
Outputs:
--------
g (:) Updated CAD model
--------------------------------------------------------------------------