How do I create such matrix ? (please look at the thread for further details)
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
Hi,
Let say I have 2 matrix A and B.
A=[1 2 3;
4 5 6]
B=[7 8 9;
10 11 12]
How do I create a matrix that becomes
C=[1-0 2-7 3-8;
4-0 5-10 6-11]
And what will happen if I have n rows and m columns for both A and B?
댓글 수: 0
답변 (2개)
How about
C = A;
C(:,2:end) = A(:,2:end)-B(:,1:end-1);
This solution is for generalized (n*m) system.
댓글 수: 2
Derick Wong
2014년 1월 3일
Amit
2014년 1월 3일
The solution written here will work for n rows and m columns system as well.
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!