How can i solve equation with backslash?

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

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!