Unable to define ScatteredInterpolant function v
1 view (last 30 days)
Show older comments
Hi guys,
I have 4 columns of data in csv, that have the x,y,z coordinates and the corresponding Temperature and i want to produce a temperature profile of the cross section at multiple points in the z-axis. I want to plot this data using the scatteredinterpolant function, but i do not have a function v to be defined since i have all the coordinates and the temperature value. So is there any way i can define v or do i have to use another function to give my object a surface/volume so that i can use the volumetric slice to churn out the temperature profile?
2 Comments
Accepted Answer
John D'Errico
on 20 Feb 2018
v IS the 4th column, thus temperature.
The other variables are your independent variables.
So essentially, scattered interpolant creates a function for you, allowing you to interpolate v(x,y,z).
You can now use it to interpolate that relation for a complete grid of say (x,y) values, at a fixed level of z. That appears to be what you want. Create the grid in (x,y) using meshgrid or ndgrid.
One thing you need to remember is that if the points of your grid lie outside the convex hull of your data, then scatteredInterpolant will generally produce a NaN result for those predictions by default. That is usually a good thing too, because extrapolation is never something done well. You will need to specify an extrapolation method otherwise.
More 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!