class1234
class1234

Reputation: 59

Horizontally concatenate column vectors that typed in multiple line

I have two matrix a ,b :

a = [ 1 2 3
      4 5 6 ]

b = [ 7 8 
      9 10 ]

I want to create a matrix c as shown below:

c = [ 1 2 3 7 8
      4 5 6 9 10 ]

but I want type this in multiple line a shown below, like this:

c = [ a(:,:),
      b(:,:) ]

because that i want arranging to multiple line, i dont want use this syntax in single line:

c = [a(:,:) b(:,:)]

Upvotes: 0

Views: 40

Answers (1)

Andy Campbell
Andy Campbell

Reputation: 2187

Three dots are your friend

c = [ a(:,:), ...
      b(:,:) ]

Upvotes: 1

Related Questions