Hey everyone, how can I write code that changes the Matrix
B=[1 1; 0 0]
into the first line of Matrix A? Just using B, Matrix A should be [1 0 1 0] (columns first). However, if we had Matrix B, as well as Matrix C being [1 1 ; 0 1], the second line of Matrix A should be from Matrix C.
So, Matrix A would be [1 0 1 0; 1 0 1 1]. How is this done!!

 채택된 답변

dpb
dpb 2016년 10월 16일

0 개 추천

>> B=[1 1; 0 0];
>> C=[1 1; 0 1];
>> A=[B(:) C(:)].'
A =
1 0 1 0
1 0 1 1
>>

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

질문:

2016년 10월 15일

댓글:

2016년 10월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by