GNOME Bugzilla – Bug 680511
new mdiag and mantidiag functions
Last modified: 2012-07-26 17:32:03 UTC
It would be helpful to create two new functions: - mdiag(Vector): create a diagonal matrix with the Vector components as its diagonal - mantidiag(Vector): same for an antidiagonal matrix (in this case we have to decide if we fill the first row or the first column at first).
mdiag(A1:A5) == =munit(5)*array(A1:A5)
OK, thanks. This leaves left the anti-diag problem, though.
IMHO, rather than a mantidiag with at most very limited usage, functions vflip and hflip that flip an array vertically or horizontally and can be used to construct an mantidiag would be much more useful.
You are right.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report. I have added a FLIP function. Then mdiag(A1:A5) == munit(5)*array(A1:A5) mantidiag(A1:A5) == flip(munit(5)*array(A1:A5)) or mantidiag(A1:A5) == flip(munit(5)*array(A1:A5), FALSE) depending on whether the values in A1:A5 should run bottom-left to top-right or top-right to bottom-left.