Adding certain 'parts' of two matrices

3 vues (au cours des 30 derniers jours)
Cheng Chang
Cheng Chang le 17 Avr 2019
Modifié(e) : Stephen23 le 17 Avr 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.

Réponse acceptée

Stephen23
Stephen23 le 17 Avr 2019
Modifié(e) : Stephen23 le 17 Avr 2019
B(2:3,2:3) = A

Plus de réponses (0)

Catégories

En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by