Like the built-in function 'cat', this function concatenates arrays along a specified dimension. However, when the other dimensions of the input arrays do not match, nonexisting values are padded with a specified value.
C = CAT2(dim, padval, A, B)
C = CAT2(dim, padval, A1, A2, A3, A4, ...)
Examples:
C = cat2(3, 0, ones(3, 3, 1), 2*ones(4, 4, 2));
C = cat2(3, {[]}, cell(3, 3, 1), cell(4, 4, 2));
For convenience, horzcat2 and vertcat2 are also provided.
Cite As
Peter H (2024). cat2 (https://www.mathworks.com/matlabcentral/fileexchange/52722-cat2), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |