View the step-by-step solution to:

Question

In this exercise you are invited to build a program that performs a concatenation of two n*m matrices: (merges the

matrices)

Example: n =3, m = 5, so 3 rows and 5 columns

Matrix a :

1 2 3 4 5

6 7 8 9 10

11 12 13 14 15

Matrix b :

16 17 18 19 20

6 7 8 9 10

11 12 13 14 15

Horizontal Concatenation Matrix:

1 2 3 4 5 16 17 18 19 20

6 7 8 9 10 6 7 8 9 10

11 12 13 14 15 11 12 13 14 15

Your program should have the following function :

concatenate() that takes 2 vectors as parameters and return an array containing the two vectors

Example: for m =5

Vector a: 1 2 3 4 5

Vector b: 6 7 8 9 10

Concatenated array: 1 2 3 4 5 6 7 8 9 10

Top Answer

#include <iostream> #include <vector> void printVec(std::vector<std::vector<int> > a) { for(int i =... View the full answer

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question