small matrix in big matrix

2 Ansichten (letzte 30 Tage)
Ayob
Ayob am 2 Jun. 2013
I want to put a small matrix (p*q) called B into a bigger matrix (m*n) called A. How can I do it. Matrix B should be put on the left-right corner of matrix A.
  3 Kommentare
the cyclist
the cyclist am 2 Jun. 2013
Bearbeitet: the cyclist am 2 Jun. 2013
[Sorry. Couldn't resist teasing the master!]

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

the cyclist
the cyclist am 2 Jun. 2013
I don't know what "left-right corner" means, but in general you can do this as:
A = magic(7);
B = magic(3);
A(2:4,3:5) = B;

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with MATLAB 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!

Translated by