How to add a matrix into a specific part of a matrix?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Matthew Olivo
am 27 Jan. 2018
Kommentiert: Star Strider
am 27 Jan. 2018
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 Kommentare
Akzeptierte Antwort
Star Strider
am 27 Jan. 2018
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 Kommentare
Weitere Antworten (1)
Jan
am 27 Jan. 2018
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.
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!