Row Wise concatenation?

2 views (last 30 days)
Rahul Badarinath
Rahul Badarinath on 16 Jul 2018
Commented: Image Analyst on 16 Jul 2018
I have 2 matrices
a= [ 1 2 3
4 5 6
7 8 9 ]
B= [9 8 7
6 5 4
3 2 1]
Output should be:
AB= [1 2 3
9 8 7
4 5 6
6 5 4
7 8 9
3 2 1]

Accepted Answer

Image Analyst
Image Analyst on 16 Jul 2018
Try this:
AB = reshape([a, B]', 3, [])' % Interleave arrays.
  1 Comment
Image Analyst
Image Analyst on 16 Jul 2018
Rahul - did you try it? It worked for me.

Sign in to comment.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices 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!