MATLAB Answers

How to solve an equation

3 views (last 30 days)
Anton Anton
Anton Anton on 27 Nov 2020
Commented: Anton Anton on 27 Nov 2020
Hello,
I have a function equation and it is difficult to set it to the value x.
If is there a matlab in which I enter numbers data and get an x result as in this example?
Thanks in advance
clear;
fOut=1/3
m=1
s=1
fOut = (exp(-0.5*((m-x)/s)^2)/(s*(2*pi)^0.5))
Get the solution
x=...

  0 Comments

Sign in to comment.

Accepted Answer

KSSV
KSSV on 27 Nov 2020
syms x
fOut=1/3
m=1
s=1
eqn = fOut -(exp(-0.5*((m-x)/s)^2)/(s*(2*pi)^0.5))== 0 ;
s = solve(eqn,x)

  1 Comment

Anton Anton
Anton Anton on 27 Nov 2020
Thank you for your response. :)
Small question, after this equation I get two positive and negative solutions, I want it to be accepted only positive how can it be done?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!