MATLAB: How to avoid the error “GRIDDATA no longer requires Qhull-specific options” when calling griddata

griddataMATLAB

After installing 2017a and running the matlab code, I am seeing the following error.
xy = -2.5 + 5*gallery('uniformdata',[200 2],0);
x = xy(:,1);
y = xy(:,2);
v = x.*exp(-x.^2-y.^2);
[xq,yq] = meshgrid(-2:.2:2, -2:.2:2);
vq = griddata(x,y,v,xq,yq,'linear',{'QJ'})
This returns the following error:
Error using griddata (line 64)
GRIDDATA no longer requires Qhull-specific options.
Please remove these options when calling GRIDDATA.
Error in XFDTD_Field_Plot_v41 (line 46)
[qz] = griddata(vertex_X,vertex_Y,H_RMS,qx,qy,'linear',{'QJ'});
What should I change to avoid the error?

Best Answer

As the error message specifies, you do not need to include Qhull-specific options anymore. Please remove 'linear',{'QJ'} from the griddata command, instead using the format specified in the following code snippet:
>> [qz] = griddata(vertex_X,vertex_Y,H_RMS,qx,qy);
For more information on how to use the "griddata" function, please refer to this documentation