Combining two matrices into one

조회 수: 6 (최근 30일)
Thomas
Thomas 2013년 9월 17일
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
Thomas
Thomas 2013년 9월 17일
Nevermind, I forgot I could just stack them with c = [a,b]

댓글을 달려면 로그인하십시오.

채택된 답변

Andrei Bobrov
Andrei Bobrov 2013년 9월 17일
편집: Andrei Bobrov 2013년 9월 17일
c = [a,b] % EDIT
Please read about concatenating arrays

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by