I want to change matrix like below picture.
How can I do?
Thanks :)

 採用された回答

KSSV
KSSV 2022 年 3 月 16 日
編集済み: KSSV 2022 年 3 月 16 日

0 投票

A = rand(4)
A = 4×4
0.2474 0.1371 0.8875 0.6324 0.2656 0.0413 0.9122 0.4274 0.4822 0.9391 0.8935 0.8856 0.9399 0.0016 0.7617 0.4273
iwant = zeros(6) ;
iwant(1:4,1:4) = A
iwant = 6×6
0.2474 0.1371 0.8875 0.6324 0 0 0.2656 0.0413 0.9122 0.4274 0 0 0.4822 0.9391 0.8935 0.8856 0 0 0.9399 0.0016 0.7617 0.4273 0 0 0 0 0 0 0 0 0 0 0 0 0 0
B = iwant ;
iwant = B(1:4,1:4)
iwant = 4×4
0.2474 0.1371 0.8875 0.6324 0.2656 0.0413 0.9122 0.4274 0.4822 0.9391 0.8935 0.8856 0.9399 0.0016 0.7617 0.4273

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

質問済み:

2022 年 3 月 16 日

編集済み:

2022 年 3 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by