Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
documentation:language_reference:objects:matrix:operations:tostring [2024/12/12 14:29] – created Maurits W. Haverkort | documentation:language_reference:objects:matrix:operations:tostring [2024/12/12 15:38] (current) – Maurits W. Haverkort | ||
---|---|---|---|
Line 3: | Line 3: | ||
### | ### | ||
- | alligned paragraph text | + | We can turn matrix objects to strings. This allows one to print matrices. One can however also change the format of the string before printing a matrix |
### | ### | ||
Line 9: | Line 9: | ||
### | ### | ||
- | description text | + | Here we change the curly brackets {,} to straight brackets [,]. |
### | ### | ||
==== Input ==== | ==== Input ==== | ||
<code Quanty Example.Quanty> | <code Quanty Example.Quanty> | ||
- | -- some example code | + | A = Matrix.New({{1, |
+ | AStr = tostring(A) | ||
+ | print(AStr) | ||
+ | BStr = string.gsub(AStr, | ||
+ | BStr = string.gsub(BStr, | ||
+ | print(BStr) | ||
</ | </ | ||
==== Result ==== | ==== Result ==== | ||
<file Quanty_Output> | <file Quanty_Output> | ||
- | text produced as output | + | { { 1 , 2 } , |
- | </ | + | |
+ | |||
+ | [ [ 1 , 2 ] , | ||
+ | [ 3 , 4 ] ] | ||
+ | | ||
===== Table of contents ===== | ===== Table of contents ===== | ||
- | {{indexmenu> | + | {{indexmenu> |