matlab计算精度是什么意思函数sinx有幂级数展开sin(x)=x-x^3/3!+x^5/5!-···利用幂级数计算sinx的Matlab程序为function s = powersin(x)% POWERSIN.Power series for sin(x).% POWERSIN(x) tries to compute sin(x)from a power seriess
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 19:43:36
matlab计算精度是什么意思函数sinx有幂级数展开sin(x)=x-x^3/3!+x^5/5!-···利用幂级数计算sinx的Matlab程序为function s = powersin(x)% POWERSIN.Power series for sin(x).% POWERSIN(x) tries to compute sin(x)from a power seriess
matlab计算精度是什么意思
函数sinx有幂级数展开
sin(x)=x-x^3/3!+x^5/5!-···
利用幂级数计算sinx的Matlab程序为
function s = powersin(x)
% POWERSIN.Power series for sin(x).
% POWERSIN(x) tries to compute sin(x)from a power series
s = 0;
t = x;
n = 1;
while s + t = s;
s = s + t;
t = -x^2/((n+1)*(n+2))*t;
n = n + 2;
end他问你对于x=pi/2的计算精度是多少,这个计算精度指的是什么啊?与相对误差有关吗?
matlab计算精度是什么意思函数sinx有幂级数展开sin(x)=x-x^3/3!+x^5/5!-···利用幂级数计算sinx的Matlab程序为function s = powersin(x)% POWERSIN.Power series for sin(x).% POWERSIN(x) tries to compute sin(x)from a power seriess
你用该函数算出来一个值
看它与实际值的误差
最低有效位就是其精度