Convert symbolic objects to character vectors
char(A) converts a symbolic scalar or a
symbolic array to a character vector.
Symbolic scalar or symbolic array.
Convert symbolic expressions to character vectors, and then concatenate the character vectors:
syms x y = char(x^3 + x^2 + 2*x - 1); name = [y, ' represents a polynomial expression']
name = '2*x + x^2 + x^3 - 1 represents a polynomial expression'
char changes the order of the terms
in the resulting character vector.
Convert a symbolic matrix to a character vector:
A = sym(hilb(3)) char(A)
A = [ 1, 1/2, 1/3] [ 1/2, 1/3, 1/4] [ 1/3, 1/4, 1/5] ans = 'matrix([[1, 1/2, 1/3], [1/2, 1/3, 1/4], [1/3, 1/4, 1/5]])'
char can change term ordering in