newton interpolation image matrix
2 views (last 30 days)
Show older comments
I worked on the Newton Interpolation. The Function is: yi = NtnInter(x,y,xi) My question is: How do I enter the x, y, xi values from my Image Matrix ?
% function newton interpolation code
function y = newtonInterpolation(X,Y,x) % interpolate values y at points x using data vectors X and Y n = length(X); % build coefficient table D = diag(Y); for m = 1:n for i = 1:n-m j = i+m; D(i,j) = (D(i+1,j)-D(i,j-1))/(X(j)-X(i)); end end % return final value y = Y(1)*ones(size(x)); for k = 2:n s = D(1,k); for i = 1:k-1 s = s.*(x-X(i)*ones(size(x))); end y = y+s; end end
0 Comments
Answers (0)
See Also
Categories
Find more on Interpolation 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!