MATLAB: Single precision data for griddata()

single-precision for griddata()

Hi
when I use griddata(x,y,v, xq,yq), x,y,v,xq,yq are all single-precision data to save the memory. but there is an error saying " the input points must be a double array.
However when I checked the online manual for griddata(). it says x,y,z, can be single or double https://www.mathworks.com/help/matlab/ref/griddata.html
So I am wondering how I can use single-precision data in griddata()?
Thanks

Best Answer

Yes, it looks like an implementation bug or a documentation bug. The fault lies with scatteredInterpolant which is called by griddata. The doc says that scatteredInterpolant accepts single arrays when it clearly doesn't.

This is worthy a bug report to Mathworks.

It looks like you're out of luck, you can't use singles with griddata.

Related Question