I have a number of m files which run a fmincon optimisation on an ODE45 problem. TO carry this out I have to output t (time) to the workspace.

But for another function I need to use the current t value to calculate something. However, as the t value has been output in the workspace (as a 93 x 1 matrix) instead of a single value calculated 93 values are.

Is there a way to use the current t value?

(if this makes sense)