How to evenly splice two block matrices together
8 views (last 30 days)
Show older comments
Travis Arnold
on 23 Jul 2019
Commented: Travis Arnold
on 24 Jul 2019
Given the block matrices
[A1, A2, A3, ... AN] and [B1, B2, B3, ... BN]
I would like to form
[A1, B1, A2, B2, A3, B3, ... AN, BN]
Is there a quick and dirty way to do this?
4 Comments
Accepted Answer
Walter Roberson
on 23 Jul 2019
The quick way is not to use individual variables for those. Put them in cell row vectors. Then
Temp = [Acell; Bcell] ;
Result = [Temp{:}] ;
The interleave logic relies on Acell and Bcell being 1xN cell arrays.
More Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!