フィルターのクリア

How to add a matrix into a specific part of a matrix?

3 ビュー (過去 30 日間)
Matthew Olivo
Matthew Olivo 2018 年 1 月 27 日
コメント済み: Star Strider 2018 年 1 月 27 日
I have one 4x4 matrix and I'm trying to add a 2x2 matrix to the middle of the 4x4 matrix. I've tried a few commands, but have mainly been told that the dimensions don't agree. I appreciate any help.
  2 件のコメント
Jan
Jan 2018 年 1 月 27 日
Please post your code and a copy of the complete error message.
Matthew Olivo
Matthew Olivo 2018 年 1 月 27 日
Matrix dimensions must agree.
Error in PS03_matrix_magic_olivo_heying (line 38) A(2,:) + M(1,:)

サインインしてコメントする。

採用された回答

Star Strider
Star Strider 2018 年 1 月 27 日
It is difficult to provide help without giving away the solution. I have a working solution. I would prefer to see your solution first, to determine what the problem is.
  4 件のコメント
Matthew Olivo
Matthew Olivo 2018 年 1 月 27 日
Thank you! Now I'm just working on making the values I change it to remain permanent, but I'll try to do that on my own first.
Star Strider
Star Strider 2018 年 1 月 27 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (1 件)

Jan
Jan 2018 年 1 月 27 日
A = reshape(1:16, 4, 4); % Some test data
E = rand(2, 2);
A(2:3, 2:3) = A(2:3, 2:3) + E;
I have no idea, what F could be. It would be useful if you explain the details.
I hope this is not a homework. Otherwise my answer made it harder for you to deliver your own solution.
  1 件のコメント
Matthew Olivo
Matthew Olivo 2018 年 1 月 27 日
It is part of a homework. I just wanted to know where to start off really because our typical professor has been out and the TA hasn't been much help in teaching the material. I don't realy understand what you given me, but it at least ives me something to experiment with since i tried everything I knew.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by