Azzera filtri
Azzera filtri

How to interpolate data points

2 visualizzazioni (ultimi 30 giorni)
Ollie
Ollie il 12 Ott 2015
Commentato: Geoff Hayes il 12 Ott 2015
I'm trying to answer the following question:
This is the code I have so far:
function [f table] = interpol(x, xdata, ydata)
N = length(xdata);
A = zeros(N,N+1);
A(:,1) = xdata;
A(:,2) = ydata;
for col = 3:N+1
for row = 1:N-1 -(col-3)
A(row,col) = (A(row+1,2+col-3)-A(row,2+col-3))/(A(row+1+col-3,1)-A(row,1));
end
end
table = A(1:N-1,3:N+1);
f = ydata(end);
for I = N:-1:1
f = f.*(x-xdata(I)) + A(1,I+1);
end
end
This doesn't seem to be returning the right answers at the moment. Where do I go from here?
  1 Commento
Geoff Hayes
Geoff Hayes il 12 Ott 2015
Ollie - please add some comments to your code. What are the inputs? What algorithms have you implemented? Why do you think that incorrect answers are being returned?

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Interpolation in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by