Scilab Home Page | Wiki | Bug Tracker | Forge | Mailing List Archives | Scilab Online Help | File Exchange
ATOMS : DiagonalMatrix details
Login with GitLab

DiagonalMatrix

Returns the diagonal matrix from a square matrix.
(2024 downloads for this version - 2024 downloads for all versions)
Details
Version
0.1
Author
Marcos Rodrigues Pinto
Owner Organization
Universidade de Fortaleza
Maintainer
Marcos Pinto
Category
License
Dependency
Creation Date
March 18, 2014
Source created on
No source archive has been provided for this toolbox version.
Binaries available on
This toolbox is in the process of being built
Description
            It is a simple script to get the diagonal matrix from a square matrix.            
Files (1)
[275 bytes]
Miscellaneous file
	  script
News (0)
Comments (2)     Leave a comment 
Comment from Samuel Gougeon -- October 21, 2018, 04:31:48 PM    
This script is useless. 
diag(diag(m)) does the same job, and much faster i guess (diag() is a built-in):

--> m = grand(5,5,"uin",0,9)
 m  = 
   3.   9.   6.   1.   0.
   2.   4.   2.   9.   1.
   3.   4.   1.   8.   8.
   0.   5.   0.   5.   1.
   9.   7.   4.   2.   7.


--> diag(diag(m))
 ans  =
   3.   0.   0.   0.   0.
   0.   4.   0.   0.   0.
   0.   0.   1.   0.   0.
   0.   0.   0.   5.   0.
   0.   0.   0.   0.   7.
Comment from Holger Nahrstaedt -- March 19, 2014, 03:00:13 PM    
This place is only for toolboxes with a defined structure
(http://wiki.scilab.org/howto/Create%20a%20toolbox).

Please put your file to https://fileexchange.scilab.org/.
Answer from Samuel Gougeon -- October 21, 2018, 04:28:19 PM    
+1
Leave a comment
You must register and log in before leaving a comment.
Login with GitLab
Email notifications
Send me email when this toolbox has changes, new files or a new release.
You must register and log in before setting up notifications.