How to Interpolate an entire data set
6 次查看(过去 30 天)
显示 更早的评论
How to Interpolate an entire data set.I have two datasets and I am trying to determine tidal energy for the lat and lon values of my elasmobranch sightings. Since teh specific sighting lat and lon dont exist in my tidal data I am trying to interpolate them.
I have tried interpolting each value seperatly, but I recieve a value of 0. I've tried both interp1 and interp2
Tides=readtable('Tide_Data_Final.csv')
C = Tides.Longitude
M= Tides.Latitude
A=Tides.Tide
F=scatteredInterpolant(C,M,A);
Anew= F(52.00,-6.00);
figure(1)
stem3(C,M, A)
hold on
stem3(52.000,-6.00, Anew, 'r')
hold off
grid on
xlabel('\sigma')
ylabel('\alpha')
interp2(C,M,A,52.000,-6.000)
采纳的回答
dpb
2023-8-1
移动:dpb
2023-8-1
unzip Tide_Data_Final
Tides=readtable('Tide_Data_Final.csv');
head(Tides)
nnz(Tides.Tide)
height(Tides)
F=scatteredInterpolant(Tides.Latitude,Tides.Longitude,Tides.Tide);
Tnew= F(52.00,-6.00)
You have a perfectly good table with real variable names; use it/them.
You created another set of variables C,M,A with no relation at all to the actual data and turned the reference to lat, lon around by doing so and couldn't see the obvious since the new variable names bore no relationship to the actual data.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interpolation of 2-D Selections in 3-D Grids 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!