Info

This question is closed. Reopen it to edit or answer.

Does this formula wrote in correct way in the matlab

1 view (last 30 days)
hello i have this formula y= -0.0459 E/(√(E²-m²))/(1-e^(0.0459 E/(√(E²-m²)))).√(E²-m²)
In matlab y= ((-0.0459*x./sqrt(x.^2-m^2))./(1-exp(0.0459*x./sqrt(x.^2-m^2)))).*sqrt(x.^2-m^2)
does this correct please

Answers (2)

Roger Stafford
Roger Stafford on 21 Aug 2014
At the right end of your formula, ".√(E²-m²)", are you sure the dot signifies multiplication? If it were to mean that, as I have pointed out in your previous thread, this would cancel out the earlier division by the same value, "√(E²-m²)". That suggests that the dot may signify an operation other than multiplication, though I am at a loss as to what it might be. You had better take a more careful look at wherever you obtained this formula from.

Adam
Adam on 20 Aug 2014
Looks like it. Does it give the correct answers for given inputs? If so then it is ,assuming you test edge cases.
  2 Comments
Roger Stafford
Roger Stafford on 22 Aug 2014
Again, the reason for that is that you are using values of x that lie between -m and +m which produces the square root of a negative number, and that gives rise to imaginary and complex numbers. There is no mystery here.

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!