How to to take a value positive of equation
14 次查看(过去 30 天)
显示 更早的评论
Hello,
This equation solves two solutions and I want to take a value x2 positive (solutions is -7.6272 and 11.6272).
I tried the method abs(x2) that no help me.
Thanks in advance
clear;
syms x
fOut=1/80;
m=2;
s=5;
eqn = fOut -(exp(-0.5*((m-x)/s)^2)/(s*(2*pi)^0.5))== 0 ;
x2 = solve(eqn,x);
x1=2*m-x2;
fprintf('The equation has two solutions is x1=%.4f\n x2=%.4f\n',x1,x2);
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!