How can I make double integration
Mostra commenti meno recenti
syms x;
syms r;
for n=1:10
for i=2:t
f1(i,n) = h * (Sast(i-1,n) + r* Y(i,n) - x) * 1 / (v(i,n)^(1/2) * sig(n) * (2 * pi)^(1/2)) * exp((-(x-m(i,n))^2) / (2 * v(i,n) * sig(n)^2)) * unifpdf(r,A(fv),B(fv));
f2(i,n) = -p * (Sast(i-1,n) + r * Y(i,n) - x) * 1 / (v(i,n)^(1/2) * sig(n) * (2 * pi)^(1/2)) * exp((-(x-m(i,n))^2) / (2 * v(i,n) * sig(n)^2)) * unifpdf(r,A(fv),B(fv));
z(i,n)=f1(i,n)+f2(i,n)
C2_1(i,n)=dblquad(z(i,n),inf,Sast(i-1,n),-inf,Sast(i-1,n))
%C2_1(i,n) = int(int(f1(i,n), x, inf, Sast(i-1,n) + r(i,n,fv)*Y(i,n)), y, inf, Sast(i-1,n) + r(i,n,fv)*Y(i,n)) + int(int(f2(i,n), x, Sast(i-1,n) + r(i,n,fv)*Y(i,n), -inf), y, inf, -inf);
%C2_1(i,n) = dblquad(f1(i,n), inf, Sast(i-1,n) + r(i,n,fv)*Y(i,n), inf, Sast(i-1,n) + r(i,n,fv)*Y(i,n)) + dblquad(f2(i,n), Sast(i-1,n) + r(i,n,fv)*Y(i,n), -inf, Sast(i-1,n) + r(i,n,fv)*Y(i,n), -inf);
end
end
I made lots of code..but can't sure why it's not work
3 Commenti
José-Luis
il 21 Mag 2013
And what does the debugger say? What does "does not work" mean?
Sunghye
il 22 Mag 2013
Walter Roberson
il 22 Mag 2013
Yes, because sym objects do not have an feval() method.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su String Parsing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!