错误使用 dynamics 输出参数太多。 出错 MAIN_forceSquared>@(t,x,u)(dynamics(x,u)) 出错 directCollocation>myCstGrad (line 627) [f, fGradRaw] = dynFun(t,x,u);