TRIQUIVER(TRI,X,Y,U,V) plots velocity vectors as arrows with components in U and V at the triangle vertices identified by the triangulated data given by TRI, X, and Y. U and V must have as many elements as X and Y.
The basic example does not work in Matlab 2016a. You need the package apparently Mick's trigradient function as a dependency. I get the error `Error using horzcat Dimensions of matrices being concatenated are not consistent.` Mick's trigradient: https://se.mathworks.com/matlabcentral/fileexchange/36837-trigradient-m Otherwise, it seems to be a well written code.
Thank you very much for your submission. In your example the magnitude of the gradient and trigradient seem to differ. Presumably, it is due to vector scaling. Could you elaborate on this? Accurate scaling is essential of course.