A high current capable boost converter is what you want.
It will run differently than a normal fixed output, slightly
variable input - you need a wide range of input from the
full speed armature voltage, to as low a RPM's back EMF
as you can manage, so that your braking recoups as much
kinetic energy as possible. And your braking effort needs
to be pedal-responsive, yet also not push more current
than the battery / superdupercapacitor / whatever can
accept (or, a backstop dissipator might be engaged if
braking demand exceeds battery charge-accept limits).
Matlab is only a means of modeling it.