python - Create a matrix made of matrices with different sizes -


i want create matrix elements matrices (with different sizes), vectors , numbers. example, have next 2 matrices, 1 vector , 1 number:

a = [1 2 3      4 5 6      7 8 9]  b = [10 11      12 13]  c = [14      15      16]  d = 17 

and obtain matrix 2x2, k, whith elements:
k_11 = a, k_12 = b, k_21 = c, k_22 = d.

the idea have possibility choose matrices, vectors or numbers of big matrix, k, "simple" elements of matrix. i.e.: k[0,0] = a, k[0,1] = b , on.

firstly, thougth obtain list of matrices, vectors , numbers k.append(a)..., figured out not able transform list matrix.
, secondly, tried create block matrix numpy.bmat. problem bmat dimensions of inputs elements must match exactly.
idea?

thanks.

first, store 4 objects in 2d list, make list numpy.matrix.

k = matrix([[a, b], [c, d]) 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

android - CoordinatorLayout, FAB and container layout conflict -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -