Guessing the value of the temperature depending of the closest neighbours(3D)

1 次查看(过去 30 天)
Sorry if my English isn't really good.
Basically, I got a bunch of temperature sensor in a 3D space (about 1000). Each of those sensor if giving me a temperature reading.
Here's an example :
Sensor #1, XYZ Position : [12,15,53], Temperature : 26
Sensor #2, XYZ Position : [32,25,23], Temperature : 22
etc.
I constructed a [1000x4] matrix in matlab of all the value. Now, I need a function to calculate the temperature of a random point in the XYZ space depending of this database. On my first try, I opted for the 'closest point analysis' approach but the result aren't good enough. I need a smart algorithm that'll give me a more precise temperature value by analyzing the closest neighbours.
Thanks you for your help,
CEL

回答(1 个)

David Young
David Young 2015-1-15
If linear interpolation is sufficient, you can try
interpolant = scatteredInterpolant(m(:,1:3), m(:,4));
temp = interpolant(x,y,z);
This assumes that your data matrix is m and that x, y, z and temperature are the columns in that order.
You can also try natural neighbour interpolation by giving a further argument to scatteredInterpolant.

类别

Help CenterFile Exchange 中查找有关 Interpolating Gridded Data 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by