如何圆符号表达式到N位在Matlab
问题描述:
当您试图绕过一个象征性的表达到N位你得到如下错误信息:如何圆符号表达式到N位在Matlab
>> format long
>> syms x;
>> round(x, 10)
Error using sym/round
Too many input arguments.
>> round(vpa(pi), 10)
Error using sym/round
Too many input arguments.
那么,如何使这项工作?
答
这是你怎么做
>> syms x; N = 6;
>> round(pi*10^N)/vpa(10^N)
ans =
3.141593
>> round(x*10^N)/vpa(10^N)
ans =
0.000001*round(1000000*x)