Anti-diagonal matrix traversal
This function takes as an input a square matrix and returns two outputs. The first is a vector containing the matrix values starting in the (1,1) entry and progressing along the anti-diagonal elements. A second output gives the sum of the elements along the anti-diagonals.
For example:
a = [1 2 3; 4 5 6; 7 8 9];
[b,c] = diagtrav(a);
b = [1 2 4 3 5 7 6 8 9];
c = [1 6 15 14 9];
Citar como
Loïc (2026). Anti-diagonal matrix traversal (https://es.mathworks.com/matlabcentral/fileexchange/27688-anti-diagonal-matrix-traversal), MATLAB Central File Exchange. Recuperado .
Compatibilidad con la versión de MATLAB
Compatibilidad con las plataformas
Windows macOS LinuxCategorías
Etiquetas
Descubra Live Editor
Cree scripts con código, salida y texto formateado en un documento ejecutable.
| Versión | Publicado | Notas de la versión | |
|---|---|---|---|
| 1.4.0.0 | - Standardized the function definition header
|
||
| 1.3.0.0 | - Added input checking to verify the input is a square matrix
|
||
| 1.0.0.0 |
