No BSD License  

Highlights from
3D/2D vector field plotter

4.27778

4.3 | 18 ratings Rate this file 71 Downloads (last 30 days) File Size: 1.75 KB File ID: #7338
image thumbnail

3D/2D vector field plotter

by Rentian Xiong

 

31 Mar 2005 (Updated 04 Apr 2005)

This function can plot both 3D and 2D vector field based on the input symbolic expression ...

| Watch this File

File Information
Description

vectline is "vector field line plotter". Depending on the dimension of coordinate axis, vectline can plot both 3D and 2D vector field line.

Example for 2D field
>> syms x y
>> F = [-y, x];
>> vectline(F,[x,y],[-1,1,-1,1])

Example for 3D field

>> syms x y z
>> F = [x*y^2, x*y, z];
>> vectline(F,[x,y,z],[-1,1,-2,3,1,3])

Required Products Symbolic Math Toolbox
MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (19)
05 Apr 2005 Peter Bodin

Really nice function. It would be even nicer if it returned the quivergroup handles, but I could easily fix that myself.

05 Apr 2005 Vince SaBella  
20 Sep 2005 Mike Weems

Awesome......just what i needed. Thanks

17 Oct 2005 Krastimir Popov  
06 Apr 2006 PAJ PANB  
10 Nov 2006 camilo calvo  
13 Dec 2006 Quentin Brandon

Works perfectly.
Compact and clean code easily tweakable.

25 Jan 2007 Will Ludington

using MATLAB R2006b intel-based mac version, the original source code does not plot. adding a line to the code to produce a new figure before the quiver command fixes the problem.
......

        u=junk(:,1:k/3,:);
        v=junk(:,k/3+1:2*k/3,:);
        w=junk(:,2*k/3+1:k,:);

figure; %<<ADD THIS LINE>>
        
        quiver3(px,py,pz,u,v,w)

28 Feb 2007 cricket4me Usulub

how the heck do i open this??

18 Jul 2008 Daniel Sutton

A very good piece of code, this should be a standard feature of MATLAB

24 Sep 2008 Paul T

Very useful function. It would be nice if it is possible to specify the density (on the plot) of the vectors. Good job.

01 Mar 2009 Arun Sahu

The Function is really useful, but would have been better if we could control the precision... to get a more accurate plot.

07 Jan 2010 Aamir

I need exactly such a plotting tool but for numeric arrays not symbolic maths. Any suggestions please?

07 Apr 2010 Jose Ortiz

Very nice!!!!

22 Nov 2010 Alexandr

Hello. Interesting code. I need this kind of graphs for my work but I cannot understand what it actually plots. Could you please tell me more about those arrows. What do they show and which values of a function are involved in the plotting? Thank you. Alex.

29 Mar 2011 Max

Exactly what I needed. Is there a way to make the values of the axes in increments of 1 instead of 2?

03 Apr 2011 David Reilly

Simple and Elegant.

18 Apr 2011 Hasitha Senanayake  
09 Nov 2011 Linford

Great so far, but I have one question: I am trying to do this for the vector field F=[0.5*x,0*y] and it's giving me an error message. Any ideas why?

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
symbolic math Rentian Xiong 22 Oct 2008 07:44:47
vector field plot Rentian Xiong 22 Oct 2008 07:44:47
3d Rentian Xiong 22 Oct 2008 07:44:47
2d Rentian Xiong 22 Oct 2008 07:44:47
line plotter Rentian Xiong 22 Oct 2008 07:44:47
field Rentian Xiong 22 Oct 2008 07:44:47
plot Rentian Xiong 22 Oct 2008 07:44:47
vector field plot Jennifer Campbell 01 Sep 2009 20:18:39
vector field plot Adam Slade 29 Oct 2009 13:17:52
2d Kurt Elst 26 Dec 2009 18:19:56
2d More Moreno 29 Oct 2010 10:15:03
vector field plot Raul 11 Nov 2010 07:40:02
quiver Raul 11 Nov 2010 07:40:21
field anjelous mawa lagu 26 Dec 2010 16:35:06
vector field plot Max 29 Mar 2011 21:01:17
3d Hsu 22 Apr 2011 03:40:45
2d Peter 15 Feb 2012 22:29:11
vector field plot MOHAMED BAKHEET 22 Feb 2012 21:46:28

Contact us at files@mathworks.com