Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Give the antidiagonal of a matrix
ResourceFunction["Antidiagonal"][m] gives the list of elements on the leading antidiagonal of the matrix m. | |
ResourceFunction["Antidiagonal"][m,k] gives the elements on the kth antidiagonal of m. |
Give the antidiagonal elements of a matrix:
In[1]:= |
Out[1]= |
Give antidiagonals one element above and below the leading diagonal:
In[2]:= |
Out[2]= |
In[3]:= |
Out[3]= |
Give an antidiagonal of a nonsquare matrix:
In[4]:= |
Out[4]= |
If k is too high or too low, an empty list is returned:
In[7]:= |
Out[7]= |
Rotate a matrix by 45 degrees:
In[8]:= |
Out[8]= |
This work is licensed under a Creative Commons Attribution 4.0 International License