how to convert answer to one single number

5 ビュー (過去 30 日間)
Faezeh Manesh
Faezeh Manesh 2019 年 9 月 20 日
コメント済み: madhan ravi 2019 年 9 月 20 日
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)
  1 件のコメント
madhan ravi
madhan ravi 2019 年 9 月 20 日
Or in your case simply use:
vpa(b)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by