How to plot and curve through N points and find coordinates of K points from curve plotted (N<<<K)

5 views (last 30 days)
I am new to MATLAB. i wish to plot a curve through N points(N=7). Later from the curve plotted i wish to extract coordinates of K points (K=50). I did find some interpolation codes for curve passing through points. For 7 points we need a polynomial of degree 6. I find it to be complicated and st time curve does not match as needed. Will spline curve do?

Answers (1)

Walter Roberson
Walter Roberson on 24 Aug 2015
coeffs = polyfit(x, y, 6);
newx = linspace(min(x), max(x), 50);
newy = polyval(coeffs, newx);
Will spline curve do? Probably not. But it will depend upon your data and upon the region where you need to interpolate and upon your meaning of "do".
  7 Comments
guru85
guru85 on 26 Aug 2015
thank you. since data is limited, i think i will predict in-between data using ANN. If i have any doubts i will contact you sir. thank you.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!