这个积分怎么解好。

5 ビュー (過去 30 日間)
kegiyor
kegiyor 2022 年 11 月 25 日
回答済み: jilitw 2022 年 11 月 25 日
没用过matlab,现在需要解这个,用int和double是最准确的吗?
如果这个方法是最准确的,只有四位小数,怎么提高精确位数呢?
谢谢。

採用された回答

jilitw
jilitw 2022 年 11 月 25 日
int和double 实际上求的是数值积分,如果你想指定显示位数,可以用 vpa。另外,你也可以直接用数值积分函数求解,精度可以通过 AbsTol 和 RelTol 参数控制
format long
syms x
f = ((12*cos(x)+sqrt(144*cos(x)^2+481)-33.5)/3.5)^2*cos(4*x);
vpa(int(f,0,0.175*pi),10)  % 10位精度
integral(matlabFunction(f),0,0.175*pi,'RelTol',1e-10,'AbsTol',1e-13)  % 绝对误差为1e-13,相对误差为1e-10
ans =
0.2084847641
ans =
0.208484764149736

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumbers and Precision についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!