how to convert answer to one single number

11 次查看(过去 30 天)
Hello Everybody,
I am trying to integrate a function as follows:\
clc
clear all
syms x
f = 2.048*exp(-((x-5.056)/0.2349)^2) + 1.089*exp(-((x-4.887)/0.4006)^2) + 0.4116*exp(-((x-9.103)/5.731)^2);
b=int(f,0,8.475167785)
I need a value for this integral but MATLAb gives me the following expression wich is useless for me:
b =
(5897199*pi^(1/2)*(erf(9103/5731) - erf(22089882261915571/201641636441096192)))/5000000 + (2181267*pi^(1/2)*(erf(24435/2003) + erf(631237152323000705/70474297293930496)))/10000000 + (18792*pi^(1/2)*(erf(50560/2349) + erf(601506357907937665/41324045018333184)))/78125
>> Do you know how I can convert this expression to a single value easily?

采纳的回答

madhan ravi
madhan ravi 2019-9-20
f = @(x) 2.048*exp(-((x-5.056)/0.2349).^2) +...
1.089*exp(-((x-4.887)/0.4006).^2) +...
0.4116*exp(-((x-9.103)/5.731).^2);
b = integral(f,0,8.475167785)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by