diagonal

Versión 1.0.0.0 (285 Bytes) por Miguel D. B.
Returns a vector with the main diagonal of a matrix. Similar to the built-in function diag
1,1K Descargas
Actualizado 14 mar 2006

Sin licencia

This file contians a function named "diagonal01" which isolates in a row vector the diagonal of a matrix (square or not), whitout using a loop. It is similar to the Matlab built-in function "diag" when used with one input argument.
For example, the instructions
» A=magic(4); A(end,:)=[], B=diagonal01(A)

Produce

A =
16 2 3 13
5 11 10 8
9 7 6 12
B =
16 11 6

Citar como

Miguel D. B. (2025). diagonal (https://es.mathworks.com/matlabcentral/fileexchange/10324-diagonal), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R11
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Operating on Diagonal Matrices en Help Center y MATLAB Answers.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versión Publicado Notas de la versión
1.0.0.0