FUNCTION REFERENCE

mat2str

Convert a matrix to text that evaluates to the matrix.

Convert a matrix to text that evaluates to the matrix.

Syntax

s = mat2str(A)

Syntax

s = mat2str(A, precision)

Rows are separated by ; and elements by a space. Logical values print as true and false, text in single quotes. A character matrix gives one quoted text per row, such as ['ab';'cd']. precision is the number of significant digits (default 15).

Example

mat2str([1 2; 3 4.5])   % '[1 2;3 4.5]'

Differences from MATLAB: The 'class' option is not supported yet.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.