Adding certain 'parts' of two matrices

3 ビュー (過去 30 日間)
Cheng Chang
Cheng Chang 2019 年 4 月 17 日
編集済み: Stephen23 2019 年 4 月 17 日
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.

採用された回答

Stephen23
Stephen23 2019 年 4 月 17 日
編集済み: Stephen23 2019 年 4 月 17 日
B(2:3,2:3) = A

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by