Cost3D:

--------------------------------------------------------------------------
   Function to be used for optimization. It computes an err magnitude
   that the optimizer uses to find the minimum.
   This function is for 3D minimum time problems.

   Since version 7.
--------------------------------------------------------------------------
   Form:
   [errMag, err, x, t] = Cost3D( lambda, d )
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   lambda         (6,1)  Costates
   d              (1,1)  Structure
                         .rhsFun      (1,:)  Associated RHS function for optimizer
                         .plotFun     (1,:) Associated plot function for optimizer
                         .x0          (6,1) Initial state from optimizer
                         .xF          (6,1) Final state from optimizer
                         .tEnd        (1,1) Final time from opimizer
                         .oDEOptions  (1,:) ode113 options
                         .errorScale  (6,1) weights for the errors

   -------
   Outputs
   -------
   errMag         (1,:)  Magnitude of the error
   err            (6,1)  Error vector
   x              (:,n)  States
   t              (1,n)  Time

--------------------------------------------------------------------------

Children:

Common: Graphics/TimeDisplay
Math: Linear/Mag