How to replace a subsection in a 5 x 5 matrix with a 4 x 2 matrix

3 ビュー (過去 30 日間)
Kendal
Kendal 2022 年 11 月 3 日
回答済み: Voss 2022 年 11 月 4 日
I have a matrix: R55 = [2,4,6,9,11;7,8,9,10,6;1,2,6,4,5;,6,9,8,5,6;1,6,5,7,5];
I need to replace the subsection of elements starting from the element located on the 1st row and 3rd column, and ending at the element located on the 4th row and 4th column with all 1's and name it R55Mod.
I need to keep the original R55 matrix to perform further manipulations.
Thanks in advance!

採用された回答

Voss
Voss 2022 年 11 月 4 日
R55 = [2,4,6,9,11;7,8,9,10,6;1,2,6,4,5;,6,9,8,5,6;1,6,5,7,5];
R55Mod = R55;
R55Mod(1:4,3:4) = 1
R55Mod = 5×5
2 4 1 1 11 7 8 1 1 6 1 2 1 1 5 6 9 1 1 6 1 6 5 7 5

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by