|
I am trying to solve what ends up being a 50 degree equation of one variable but solve command is taking forever. Code is below.
Is there any way I can do this faster? Is there a newton's method function or bijection function in matlab?
Thanks
L=10;
t=[-20:.01:20];
t2=[-20,1,20];
p=.2;
fone=(1/(sqrt(2*pi)))*exp((-1/2)*(t.^2));
ftwo=(1/(2*sqrt(2*pi)))*exp((-1/8)*(t.^2));
fjoint=p*(fone-ftwo)+ftwo;
integrand=((fone-ftwo).^2)./(fjoint);
f1=randn(1,L);
f2=2*randn(1,L);
f3=((f1-f2).^2);
f4=(p*(f1-f2)+f2);
dist=f3./f4;
plot(t,fjoint);
syms a;
area=trapz(t,fjoint);
f1=(1/(sqrt(2*pi)))*exp((-1/2)*(dist.^2));
f2=(1/(2*sqrt(2*pi)))*exp((-1/8)*(dist.^2));
fjoint2=((f2-f1)./(a*(f2-f1)+f2));
S=sum(fjoint2);
solve(S,.2)
|