Adding certain 'parts' of two matrices

1 view (last 30 days)
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.

Accepted Answer

Stephen23
Stephen23 on 17 Apr 2019
Edited: Stephen23 on 17 Apr 2019
B(2:3,2:3) = A

More Answers (0)

Categories

Find more on Multidimensional Arrays in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!