File Exchange

image thumbnail

vfield_color

version 1.0 (2.29 KB) by

Plot a 2-D vector field, where color is defined by a colormap and indicates vector magnitude.

9 Downloads

Updated

View License

The function VFIELD_COLOR plots 2-D velocity vectors with colors defined by a colormap.

Syntax:
VFIELD_COLOR(X,Y,U,V,SCALE,CMAP)

Inputs:
X, Y Arrows origin, N-D arrays
U, V Current components, N-D arrays
SCALE Scalar value to set vector lengths
CMAP Colormap, N x 3 array of RGB values

Example:
image = zeros(100);
x = (rand(1,50) .* 80) + 10;
y = (rand(1,50) .* 80) + 10;
u = rand(1,50) .* 100;
v = rand(1,50) .* 100;
cmap = jet(64);
scale = 10;
vfield_color(image,x,y,u,v,scale,cmap)

See also QUIVER, FEATHER, VFIELD

** The current implementation doesn't return handles to the graphics objects created by vfield.

Comments and Ratings (1)

guanglei wang

GOOD

MATLAB Release
MATLAB 7.0.4 (R14SP2)
Acknowledgements

Inspired by: vfield

Inspired: quiverwcolorbar

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today