How can i solve equation with backslash?

2 views (last 30 days)
Y = A/x + B*exp(-2x^2)
How do I set up the normal equations for this to solve for a and b using backslash?

Accepted Answer

Walter Roberson
Walter Roberson on 30 Sep 2017
Create
M = [1./x(:), exp(-2.*x(:).^2)]
now solve M*[a;b] = Y using the backslash operator

More Answers (0)

Categories

Find more on Linear Algebra 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!