How to interpolate with more interpolation points?

2 次查看(过去 30 天)
Hi everyone, below this the script of interpolation. By using this script, I managed to interpolate if there is only one point / location where I want to estimate the data. However, I have a lot of points / locations to be estimated. I tried to modified the example script below, and the outcome for the first and second location are the same. Can anyone know what's the problem with the modified script?
clc;clear all; close all;
%% Collected Data
X = 1e3.*[40; -45; 45];
Y = 1e3.*[60;-30;-70];
Z = [24.6; 26.4; 25.2];
%% Location for data estimation
XI = 1e3*[10;11;20];
YI = 1e3*[15;16;19];
%% Covariance Data Matrix
for k=1:3
for m=1:3
dkm(k,m)=sqrt(abs(X(k)-X(m))^2+abs(Y(k)-Y(m))^2);
end
end
Ckm=(1-0.01)*dkm
for k=1:3
for j=1:length(XI)
dki(k,length(XI))=sqrt(abs(X(k)-XI(j)).^2+abs(Y(k)-YI(j)).^2);
end
end
Cki=(1-0.01)*dki
%%
w=inv(Ckm)*Cki
% BE CAREFUL: BAD ESTIMATION if means is not substracted
ZI=w'*Z
% GOOD ESTIMATION if the mean is removed
Zprim = Z-mean(Z);
ZIprim = w'*Zprim;
ZIgood = mean(Z)+ZIprim
Append2 = [XI YI ZI ZIgood];

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by