-
Notifications
You must be signed in to change notification settings - Fork 17
Description
This change was a little more involved (no MEX file unfortunately, just straight Matlab). Basically, there are 2 kinds of interpolant classes in matlab, griddedInterpolant and scatteredInterpolant. The gridded version is the one that interpn() uses and requires the matrix to be plaid, etc. The scattered version is the one that griddata() uses, which I think is confusingly named since you don’t need a grid. What’s nice with the scatteredInterpolant is that you just pass in XYZ coordinates and the value at each coordinate, and it figures out the interpolant from there. So basically, in the read_dot_dyn function, you can remove all that meshgrid stuff that happens after the textscan, and just pipe the 4 vectors (X,Y,Z, Val) directly into the interpolation function. I chose to implement this approach using the scatteredInterpolant() rather than griddata(), but either could work.