smprintfΒΆ
smprintf formats a double or string matrix and returns the data as a scalar string or string matrix.
- smBuffer = smprintf(ssFormat, mValues)
- ssBuffer = smprintf(ssFormat, mValues, ssColSep, ssLineSep)
Return Value
ssBuffer is a scalar string containing the result of the conversion. If called with two parameters the function returns a string matrix >*smBuffer*.
Parameters
- ssFormat
ssFormat is a scalar string with embedded formatting symbols. It specifies how the arguement mValues are formatted. The parameter is described in the function printf.
- mValues
mValue is a double or string matrix.
- ssColSep
ssColSep is a scalar string that is used to separate the columns. Example:
\t
is a tab charater or a comma,
.
- ssLineSep
ssLineSep is a scalar string that is used to separate the rows. Example:
\n
is a new line character.
Comment
If called with two parameters the function returns a matix of the same size as the matrix mValues.
Example
* a = [1,2,3;4,7.987,6]
* smprintf("%10.3lf", a, "\t", "\n");
1.000 2.000 3.000
4.000 7.987 6.000
id-1625601