Unable to define ScatteredInterpolant function v

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

Why you are unable? What error you get?
Hi KSSV,
i'm not sure what to define for v since i already have the data for x,y,z coordinates as well as the corresponding temperature...

Sign in to comment.

 Accepted Answer

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)

Asked:

on 20 Feb 2018

Commented:

on 20 Feb 2018

Community Treasure Hunt

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

Start Hunting!