MATLAB Answers

0

Adding certain 'parts' of two matrices

Asked by Cheng Chang on 17 Apr 2019
Latest activity Edited by Stephen Cobeldick on 17 Apr 2019
Hi guys,
I have two matrices:
A=[1 2;
3 4]
and
B=[0 0 0 0;
0 0 0 0;
0 0 0 0;
0 0 0 0]
now I want to add matrix A to the second and third rows and columns of matrix B, so it becoms:
C=[0 0 0 0;
0 1 2 0;
0 3 4 0;
0 0 0 0]
How can I do that?
Thank you all guys.

  0 Comments

Sign in to comment.

Products


Release

R2019a

1 Answer

Answer by Stephen Cobeldick on 17 Apr 2019
Edited by Stephen Cobeldick on 17 Apr 2019
 Accepted Answer

B(2:3,2:3) = A

  0 Comments

Sign in to comment.