| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Symbolic Math Toolbox |
| Contents | Index |
| Learn more about Symbolic Math Toolbox |
char(A)
char(A, d)
char(A) converts a symbolic scalar or a symbolic array to a string.
char(A, d) converts a symbolic scalar or array to a string. For symbolic arrays, the second parameter specifies the form of the resulting string. For symbolic scalars, this parameter does not affect the result. d will be removed in a future release.
A |
A symbolic scalar or a symbolic array |
d |
d will be removed in a future release. A number that specifies the format of the resulting string. For symbolic arrays: char (A, 1) results in matrix([...]) char(A, 2) results in matrix([[...],[...]]) char(A, d) for all other values of the parameter d results in array([1..m, 1..n, 1..p], [(1,1,1) = xxx,...,(m,n,p ) = xxx]) |
Convert symbolic expressions to strings, and then concatenate the strings:
syms x; y = char(x^3 + x^2 + 2*x - 1); name = [y, ' presents a polynomial expression']
The result is:
name = x^3 + x^2 + 2*x - 1 presents a polynomial expression
Convert a symbolic matrix to a string:
A = sym(hilb(3)) char(A)
The result is:
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]])
![]() | ceil (sym) | clear all | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |