帮助中心帮助中心
将矩阵转换为字符串
str = mat2str(A)
str = mat2str(A, n)
str = mat2str(A, 'class')
str = mat2str(A, n, 'class')
示例
str = mat2str(A) 将 fi 对象 A 转换为字符串表示。其输出适合作为 eval 函数的输入,它可使 eval(str) 精确地产生原始的 fi 对象。
str
A
fi
eval
eval(str)
str = mat2str(A, n) 使用 n 位精度将 fi 对象 A 转换为字符串表示。
n
str = mat2str(A, 'class') 创建包含 A 的类名称的字符串表示。此选项可确保计算 str 的结果中同时包含类信息。
str = mat2str(A, n, 'class') 使用 n 位精度,且包含 A 的类。
全部折叠
将 fi 对象 a 转换为一个字符串。
a
a = fi(pi); str = mat2str(a)
str = '3.1416015625'
将 fi 对象 a 转换为一个使用八位精度的字符串。
a = fi(pi); str = mat2str(a, 8)
str = '3.1416016'
输入数组,指定为标量、向量或矩阵。A 不能为多维数组。
数据类型:fi|single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
single
double
int8
int16
int32
int64
uint8
uint16
uint32
uint64
输出中的精度位数,指定为正整数。
数据类型: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
输入数组的字符串表示,以字符数组形式返回。
在 R2015b 中推出
mat2str | tostring
mat2str
tostring
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office