The following Matlab project contains the source code and Matlab examples used for like cat, but padding with nans. doesn't complain if input sizes heterogeneous. faster than catpad. . I wrote this some years back before I knew CATPAD existed.
The source code and files included in this project are listed in the project files section, please make sure whether the listed source code meet your needs there.