Main Content

mlreportgen.utils.toString

Create string representation of MATLAB variable

Description

example

convValue = mlreportgen.utils.toString(varName) converts the value of a MATLAB® variable to a string.

Examples

collapse all

num = 10;
convValue = mlreportgen.utils.toString(num)
convValue =
    "10"
matrix = [1,7,10;3,1,6];
convValue = mlreportgen.utils.toString(matrix)
convValue =
    "[1   7  10 ;
      3   1   6 ]"

Input Arguments

collapse all

MATLAB variable whose value is to be converted to a string.

Output Arguments

collapse all

Converted MATLAB variable value, returned as a string scalar

Version History

Introduced in R2018b