Code covered by the BSD License  

Highlights from
vfield3

4.0

4.0 | 5 ratings Rate this file 7 Downloads (last 30 days) File Size: 3 KB File ID: #8653
image thumbnail

vfield3

by M MA

 

05 Oct 2005 (Updated 12 Oct 2005)

Plot 3D velocity field.

| Watch this File

File Information
Description

Plots 3-D arrows as cones. Is similar to CONEPLOT but the inputs can have any dimension.

Syntax:
   HANDLE = VFIELF3(X,Y,Z,U,V,W,VARARGIN)

Inputs:
   X, Y, X Positions, N-D arrays
   U, V, W Field, N-D arrays
   VARARGIN:
      CData, by default the speed is used as CData
      'color', <color>, patches color (then CData is not used)
      'tr', <val>, tip length with respect to intensity or absolute length if is a string [ <value> <value as string> {0.3} ]
      'ar', <val>, arrow radius with respect to tip width/2 [0.3 ]
      'fi' <deg>, tip angle [ 20 ]
      'n', <num>, ponts used in the circunferences [ 25 ]

The screenshot shows:
r = linspace(0.5,1,2);
tt = linspace(0,2*pi,20);
[r,tt] = meshgrid(r,tt);
[x,z] = pol2cart(tt,r);
y = zeros(size(x));
u = zeros(size(x));
v = 2-r.^2; v=v./1.5;
w = zeros(size(x));
 
vfield3(x,y,z,u,v,w);
vfield3(x,y+2,z,u,v,w,'tr',1,'fi',5);
vfield3(x,y+4,z,u,v,w,'ar',1,'fi',10);
 
caxis([-0.5 2])
axis equal
camlight
view(50,30)

MATLAB release MATLAB 6.0 (R12)
Tags for This File  
Everyone's Tags
3d currents, arrows, cones, field, graphics, plotting, specialized, velocity
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
12 May 2009 Jveer

niice!

12 May 2009 fabio freschi

Nice application and great use of vectorization instead of for loops. I personalized this application for my purposes, but thanks to author for his work

24 Sep 2008 Michael G

This is a great ap that I find I am using all the time now for plotting and animating vector fields. It looks great!

06 Oct 2005 waleed nsr  
06 Oct 2005 waleed nsr  
Updates
12 Oct 2005

Corrected a bug in CData

Contact us