Contents Previous Next Subchapters

Conversion of Text Matrix to a Double Precision Matrix
Syntax char2dbl(textseparator)
See Also atod , align

Description
Returns a double precision matrix containing the free format values represented by text. The return value has the same row dimension as text. The columns dimension is equal to the maximum number of fields in any of the rows of the matrix text.

The character row vector separator specifies a list of character that separate fields in each row of text (each field in text corresponds to a column in the return value).

Example
If you enter
     text = { ...
          "1,2,3",   ...
          "4;,5; 6", ...
          "7  8  9"  ...
     }
     separator = ",; "
     x  = char2dbl(text, separator)
     print x
O-Matrix will respond
     {
     [ 1 , 2 , 3 ]
     [ 4 , 5 , 6 ]
     [ 7 , 8 , 9 ]
     }
Note that a connected sequence of separators characters have the same effect as one separator character.

Reference
If no value is present for a certain field, the value zero is returned. For example, if you enter
     text = { ...
          "1,2",     ...
          "4;,5; 6", ...
          "7  8"     ...
     }
     separator = ",; "
     x  = char2dbl(text, separator)
     print x
O-Matrix will respond
     {
     [ 1 , 2 , 0 ]
     [ 4 , 5 , 6 ]
     [ 7 , 8 , 0 ]
     }