https://in.mathworks.com/help/fininst/capbyhjm.html
capbyhjm - Price cap instrument from Heath-Jarrow-Morton interest-rate tree - MATLAB
This MATLAB function computes the price of a cap instrument from a Heath-Jarrow-Morton interest-rate tree.
price cap