description to solve equation involved integration

1 view (last 30 days)
Hi everyone, I have a question:
g(u) = inline('sqrt(2*pi*(delta)^2)*exp(-2*(pi^2)*(delta^2).*(u.^2))','u');
delta = [-1:0.001:1];
g(u) = 0.95;
integral g(u) with lower limit = -1/(2*x) and upper limit = 1/(2*x);
How can I express the integral(u) in Matlab to solve for x ;
Please help me
  1 Comment
Rik
Rik on 15 Feb 2022
Regarding your email ("Do you have an email?"):
Yes I do. If you have a question, post it on this forum. If you want to make sure I see your question, feel free to send me the link. Other than that I prefer to only be contacted about my File Exchange submissions.

Sign in to comment.

Accepted Answer

David Hill
David Hill on 12 Feb 2022
I am somewhat guessing this is what you want. Execution might take a few minutes. Reduce the delta array for faster execution.
syms x u
delta=-1:.001:1;
A=zeros(size(delta));
for k=1:length(delta)
g = sqrt(2*pi*(delta(k))^2)*exp(-2*(pi^2)*(delta(k)^2)*(u^2));
eqn=int(g,u,-1/(2*x),1/(2*x))==.95;
A(k)=vpasolve(eqn,x);
end

More Answers (0)

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!