作业帮 > 综合 > 作业

matlab 用num2str函数如何保留小数点后10位

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/21 11:43:54
matlab 用num2str函数如何保留小数点后10位
C是矩阵两列30.235909116700000, 30.235909116700000.我想实现转换为str型,但是用
C = num2str( C );函数后 C只能保留矩阵小数点后四位,数据失真.请问怎么能保留后十位?
% str = num2str(a, precision) converts the array A into a string
% representation str with maximum precision specified by precision.
% Argument precision specifies the number of digits the output string
% is to contain. The default is four.
>> num2str(C,12)
ans =
30.2359091167 30.2359091167