MATLAB: How to track the vector magnitude in quiver plot

data cursorquiver

Hello Matlabers,
When I use quiver to get a vector plot, I find that I couldn't use data cursor to track the value of the clicked point. Is it possible to do this by data cursor? If it's impossible, how can I do to get the vector magnitude when I click the arrow in the plot?
Thanks in advance.
Xiaoliang

Best Answer

If you use quiver(x,y,u,v), the data cursor mode will show the (x,y,u,v) value for every point that is plotted. I guess you want the value of sqrt(u^2+v^2). That is not available in the plot. If you want to have that, you need to plot it somewhere in the figure.
use quiver(x,y,u,v,scale) to adjust the length of the arrow line.
Follow Doug's video tutorial to create a customized data cursor function. http://blogs.mathworks.com/videos/2011/02/25/creating-a-custom-data-cursor/