By default, the solver returns the solution vector for all stages as multiple outputs. Alternatively, the user can pass a third argument to the function FORCES_NLP() with an array that specifies what the solver should output. To define a standard output as a slice of the primal solution vector, use the function
output = newOutput(name, maps2stage, idxWithinStage)
where name is the name you give to the output (you will need this to read it after calling the solver). The index vector (or integer) maps2stage defines to which stage this output maps to. The last argument, idxWithinStage allows the user to select which indices from the stage vector should be outputted by the solver.
To define an output to be the first two elements of the stage variables along the horizon, use the following command:
output1 = newOutput('myOutputVector', 1:model.N, 1:2)