[SciPy-user] Easy way to make a block diagonal matrix?

Ivo Maljevic ivo.maljevic@gmail....
Wed May 20 17:48:08 CDT 2009


I am pretty sure kron() function doesn't work. I've used it both in matlab
and with scipy to insert zeros or repeat vectors.
Your function is very well written.



2009/5/20 Stéfan van der Walt <stefan@sun.ac.za>

> 2009/5/20 Joshua Stults <joshua.stults@gmail.com>:
> > Probably numpy.kron() already provides this functionality plus easily
> > generating more general block matrices:
> >
> > http://docs.scipy.org/doc/numpy/reference/generated/numpy.kron.html
>
> numpy.kron takes two arrays as input, so I'm not sure how that could
> work, especially for diagonal blocks with varying shapes?  Would you
> use object arrays? Could be that my brain has gone to bed already!
>
> Regards
> Stéfan
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20090520/0bd142e2/attachment.html 


More information about the SciPy-user mailing list