How to solve equation from curve fitting?

1 view (last 30 days)
Michael Adam
Michael Adam on 24 Nov 2015
Answered: Michael Adam on 24 Nov 2015
This is probably really easy, however I am new in Matlab and cannot find a solution, so i have a graph and saved the coeffs in workspace after using basic fitting using spline so that it matches the curve, my question is i need to solve x for f(x)=Y, without guessing everytime how what x could be, how can i solve the equation so that i can find x easy and fast. Thanks for your time
  2 Comments
Walter Roberson
Walter Roberson on 24 Nov 2015
If I understand correctly, you have a set of piecewise polynomials (cubic coefficients with breakpoints) derived from a spline fit, and for given Y values you want to find the x that would give that Y.
The difficulty with this is that there would generally be multiple solutions.
For example you can fit a cubic spline to several periods of sin(x). If you then ask to solve for Y = 0, you are going to generate multiple results.
Do you want all of the results implied by the spline structure?
Michael Adam
Michael Adam on 24 Nov 2015
yes exactly with breakpoints, i dont thinke there are multiple solutions.

Sign in to comment.

Answers (1)

Michael Adam
Michael Adam on 24 Nov 2015
Spline with breakpoints and the graph looks like this for 500, 750, 1000, 1500 bar

Products

Community Treasure Hunt

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

Start Hunting!