Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
documentation:language_reference:objects:matrix:functions:diagonal [2018/09/25 12:11] – created Simon Heinze | documentation:language_reference:objects:matrix:functions:diagonal [2018/09/26 15:06] (current) – Added Code Example Simon Heinze | ||
---|---|---|---|
Line 4: | Line 4: | ||
### | ### | ||
Matrix.Diagonal($\{x_1, | Matrix.Diagonal($\{x_1, | ||
+ | |||
+ | If the option " | ||
### | ### | ||
===== 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 } } | ||
</ | </ | ||