Combine the Rows of 2 Matrices
No License
"Pairing up" two matrices produces all ways rows from each can concatenate.
Note that a (r,s) matrix and a (t,u) matrix provides that pairup will produce a ( r*t, s+u ) matrix.
Note that this requires REPROWS.M which is also submitted to
the MATLAB Central File Exchange - Utilities - Miscellaneous.
Example: A pairup of a 2-by-3 matrix and a 3-by-2 matrix will produce a 6-by-5 matrix.
A is
a b c
d e f
B is
u v
w x
y z
pairup( A, B ) is
a b c u v
a b c w x
a b c y z
d e f u v
d e f w x
d e f y z
I used this to prepare case datas for parallel processing in survey.
Cite As
Tom Baker (2024). Combine the Rows of 2 Matrices (https://www.mathworks.com/matlabcentral/fileexchange/4816-combine-the-rows-of-2-matrices), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxTags
Acknowledgements
Inspired by: Reproduce Matrix Rows
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 |