Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

set a matrix as an element of another matrix

is it possible to insert a matrix as an element of another matrix?
for example, I have this matrix as c :

| A  | b |
| -------- | -------------- |
| c11    | c12            |
| c21   | c22            |

now assume that I want to set this matrix as c11:

| g  | h |
| -------- | -------------- |
| r11    | r12            |
| r21    | r22            |

is it possible in python?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

c11 = np.array([[r11,r12],[r21,r22]])
c12 = np.array([[r11,r12],[r21,r22]])
c21 = np.array([[r11,r12],[r21,r22]])
c22 = np.array([[r11,r12],[r21,r22]]) 

c = np.array([[c11,c12],[c21,c22]])
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading