Code covered by the BSD License  

Highlights from
quiver3d

3.8

3.8 | 5 ratings Rate this file 39 Downloads (last 30 days) File Size: 4 KB File ID: #6066
image thumbnail

quiver3d

by

 

18 Oct 2004 (Updated )

This function provides an improvement over the QUIVER3 technique for visualizing 3D vector fields.

| Watch this File

File Information
Description

% QUIVER3d *True* 3D quiver plot.
%
% This function provides an improved technique for visualizing 3D
% vector fields. It relies on the efficient use of a single patch
% call and lighting effects to provide depth cueing.
%
% QUIVER3D(X,Y,Z,U,V,W) plots velocity vectors as arrows with components
% (u,v,w) at the points (x,y,z). The matrices X,Y,Z,U,V,W must all be
% the same size and contain the corresponding position and velocity
% components. QUIVER3D automatically scales the arrows to fit.
%
% QUIVER3D(X,Y,Z,U,V,W,COLOR) provides an input argument for coloring
% the vecotors. The COLOR argument can be a single color ([1x3] or
% [3x1]), and indexed color ([1xN] or [Nx1]), or a true color ([3xN or
% Nx3). Where N is equal to the number of elements in X or Y or Z or...
%
% QUIVER3D(X,Y,Z,U,V,W,COLOR,S) automatically
% scales the arrows to fit and then stretches them by S.
% Use S=0 to plot the arrows without the automatic scaling. S=1
% provides simple autoscaling.
%
% QUIVER3D(X,Y,Z,U,V,W,COLOR,S,N) provides an input that defines the
% density of the tessellation used in generating the arrows. If N is
% high (>15) then the rendering time can be long and interactivity of
% the rendering can be slow. If N<15 the rendering is generally quick
% for ~100s of vectors. The default is N=15;
%
% H = QUIVER3D(...) returns a patch object of the arrow cluster.
%
% Example:
% quiver3d; % Generates a sample output of the function.
%
% DBE 10/17/04

MATLAB release MATLAB 7 (R14)
Other requirements Hopefully none! Let me know!
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (13)
24 Dec 2011 Mahmood dandelion

I have a 119*255 cell array that contains land and sea area, I set the earth values to NaN and try to use quiver for plot velocity arrow but the result does not look good, because there is a dot on every land point and the arrows are not detectable.
I tried to prepare a matrix of x y u and v and then use quiver the result comes better but not good yet, because sometimes there are 2 arrow from 1 point.
look at this: https://sites.google.com/site/physic4ocean/Home/om2.png?attredirects=0&d=1

would someone help me to prepare a good look of current in this large area?

is it possible to send me a file please?

I am using R2010a and my original file is a nc file.

thank you
Dandelion
apt.man@gmail.com

15 Mar 2011 Ben

It only plots 2 arrows when I give it a command to plot 3 arrows (coordinate frame unit vectors)??? I can't seem to figure out why this is happening.

quiver3d([0,0,0],[0,0,0],[0,0,0],[1 0 0],[0 1 0],[0 0 1])

08 Jan 2009 Divahar Jayaraman

Works Great...

Best wishes

Thanks,

Divahar Jayaraman

25 Sep 2008 avi tzur  
30 Mar 2006 R Heavy

Weird, happened again. The characters after the ampersand should be "amp" without the quotes.

30 Mar 2006 R Heavy

Something got cut off in the last message:

The cursor was placed at the end of:
...==1 &amp

30 Mar 2006 R Heavy

Couldn't even run the demo mode. Error message reads:

??? Error: File: quiver3d.m Line: 77 Column: 43
Incomplete or misformed expression or statement.

Cursor placed at the end of:
indexed_color=(size(arrow_color,1)==1 &amp

"amp" does not show up previous to this point.

15 Mar 2006 Andrew Moss

I got an error every time I tried to run this function. Here are some samples I tried. I really didn't have time to go through your code much so I have no idea what it might be, I may even just be using it wrong but I thought I would let you know anyway

>> quiver3d
??? In an assignment A(:,matrix) = B, the number of elements in the subscript of A and the number
of columns in B must be the same.

Error in ==> F:\MATLAB Files\quiver3d.m
On line 115 ==> Evct(:,2)=cross(Evct(:,1),[1 0 0])/norm(cross(Evct(:,1),[1 0 0]));

>> quiver3d(1,1,1,0,0,1)
??? In an assignment A(:,matrix) = B, the number of elements in the subscript of A and the number
of columns in B must be the same.

Error in ==> F:\MATLAB Files\quiver3d.m
On line 115 ==> Evct(:,2)=cross(Evct(:,1),[1 0 0])/norm(cross(Evct(:,1),[1 0 0]));

02 Feb 2006 Daniel Ennis

I welcom constructive feedback. I am happy to make changes to the function. If you can provide more details I can likely fix the problem, but the example you provide works as expected on my platform.

01 Feb 2006 Paulo J. Paupitz Goncalves

have you tried something really simple as:
quiver3d(0,0,0,1,0,0)

I got and error.

Regards

21 Oct 2004 urs Schwarz (us)

very nice work, Daniel!

20 Oct 2004 Daniel Ennis

The rot3d function call should have been commented out. The two lines the precede it were intended to replace it. Another minor modification was also submitted that changes the way the arrow body diameter is scaled.

20 Oct 2004 Valeri Karlov

function rot3d is missing when run quiver3d example

Contact us