Combining two matrices into one

6 Ansichten (letzte 30 Tage)
Thomas
Thomas am 17 Sep. 2013
I need to combine the two matrices a and b to yield c.
a = [1;0] and b = [0;1]
and for c I need to matrix to look like this c = [1,0;0,1] not [1;1]
I was using c = a + b, is there a way I can combine the matrices without adding the numbers together?
Thank you for your time.
  1 Kommentar
Thomas
Thomas am 17 Sep. 2013
Nevermind, I forgot I could just stack them with c = [a,b]

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Andrei Bobrov
Andrei Bobrov am 17 Sep. 2013
Bearbeitet: Andrei Bobrov am 17 Sep. 2013
c = [a,b] % EDIT
Please read about concatenating arrays

Weitere Antworten (0)

Kategorien

Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by