フィルターのクリア

How to to take a value positive of equation

9 ビュー (過去 30 日間)
Emilia
Emilia 2020 年 11 月 27 日
コメント済み: Emilia 2020 年 11 月 27 日
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);

採用された回答

KSSV
KSSV 2020 年 11 月 27 日
sol = double(x2) ;
sol(sign(sol)==1)
  1 件のコメント
Emilia
Emilia 2020 年 11 月 27 日
Thank you

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by