How do I compute symbolic integrals

This is my code,I want to compute symbolic integrals,but the F1 I got is full of NAN.Why?and what should I do?
format long;
t=1:10000:8460000;
k=0.07;b=13.8'; ,
c=3e8;
v=0.062.*c;
eNi=3.9e10;
eCo=6.8e9;
tNi=8.8*86400;
tCo=111.3*86400;
M=1.9891e30;
Mej=2.1.*M;
kr=0.133;
A=(3.*kr.*Mej)/(4.*pi.*v^2);
M_Ni=0.1.*M;
tm=sqrt((2.*k.*Mej)/b.*v.*c);
P=@(x)eNi.* M_Ni.*exp(-x./tNi) + eCo.* M_Ni.*((exp(-x./tCo)-exp(-x./tNi))./(1-tNi/tCo));
f=@(x)exp(x.^2./tm^2).*x./tm.*P(x);
syms a
F=int(f,0,a);
F1=double(subs(F,a,t));

 采纳的回答

Wanted=zeros(size(t));
for k=1:numel(t)
Wanted(k)=integral(f,0,t(k));
end

更多回答(0 个)

类别

帮助中心File 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