OCTBEC - A Matlab toolbox for optimal quantum control of Bose-Einstein condensates. OCTBEC is a Matlab toolbox designed for optimal quantum control, within the framework of optimal control theory (OCT), of Bose–Einstein condensates (BEC). The systems we have in mind are ultracold atoms in confined geometries, where the dynamics takes place in one or two spatial dimensions, and the confinement potential can be controlled by some external parameters. Typical experimental realizations are atom chips, where the currents running through the wires produce magnetic fields that allow to trap and manipulate nearby atoms. The toolbox provides a variety of Matlab classes for simulations based on the Gross–Pitaevskii equation, the multi-configurational Hartree method for bosons, and on generic few-mode models, as well as optimization problems. These classes can be easily combined, which has the advantage that one can adapt the simulation programs flexibly for various applications.