Skip to content

mat2str

strings · scripts/strings/mat2str.m

: s = mat2str (x)
: s = mat2str (x, n)
: s = mat2str (x, n, "class")
: s = mat2str (x, "class")

Write a 2-D numeric, logical or char array as text that evaluates to the same array.

Numbers carry n significant digits (default 15). With "class" the class name is written in front. Char arrays are written as quoted text. Integer values at or beyond flintmax are wrapped in int64/uint64 inside a non-scalar "class" form so eval round-trips.