Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
documentation:language_reference:objects:matrix:functions:diagonal [2018/09/25 14:34] – Added Userdata Option Remark Simon Heinze | documentation:language_reference:objects:matrix:functions:diagonal [2018/09/26 15:06] (current) – Added Code Example Simon Heinze | ||
---|---|---|---|
Line 9: | Line 9: | ||
===== Example ===== | ===== Example ===== | ||
- | |||
- | ### | ||
- | The day may come on which this documentation page has an example. | ||
- | ### | ||
==== Input ==== | ==== Input ==== | ||
<code Quanty Example.Quanty> | <code Quanty Example.Quanty> | ||
- | -- some example code | + | xlist = {17,3,-4*I, sqrt(6)} |
+ | M = Matrix.Diagonal(xlist) | ||
+ | print(M) | ||
</ | </ | ||
==== Result ==== | ==== Result ==== | ||
<file Quanty_Output> | <file Quanty_Output> | ||
- | text produced as output | + | { { 17 , 0 , 0 , 0 } , |
+ | { 0 , 3 , 0 , 0 } , | ||
+ | { 0 , 0 , (-0 - 4 I) , 0 } , | ||
+ | { 0 , 0 , 0 , 2.4494897427832 } } | ||
</ | </ | ||