No BSD License  

Highlights from
Plot a plane or line in 3D

2.0

2.0 | 1 rating Rate this file 43 Downloads (last 30 days) File Size: 7.42 KB File ID: #22158
image thumbnail

Plot a plane or line in 3D

by Calvin Price

 

19 Nov 2008 (Updated 26 Dec 2008)

User specifies two independent vectors, and the corresponding plane is graphed.

| Watch this File

File Information
Description

The user supplies two independent 3x1 vectors, and output is a graph of the plane generated by these two vectors. A single input of one 3x2 matrix is also ok.

The user may specify just one vector. The plot will
then be just the line generated by that vector.

The plot will also be a line if the two input vectors are linearly
dependent.

Optional 3rd argument: User may also specify a string that determines the plot style of the plane, using the same string options as for MATLAB's plot function.

OTHER FUNCTIONS REQUIRED: arrow3D.m (by Shawn Arseneau), column3D.m, scatter3_2.m, normalize.m, rotatePoints.m
(all of these are included in zip file)

EXAMPLE: >> plotp([1;1;1],[2;2;-4])
                  >> plotp([1;1;1],[3;-3;0],'m')

EXAMPLE: for matrix of rank 1, plot the 2 dimensional nullspace (a plane), and 1 dimensional row space (a line), the two should be visibly orthogonal subspaces

>> A=[1 0 0; 2 0 0; 3 0 0]

A =

     1 0 0
     2 0 0
     3 0 0

>> hold on
>> plotp(null(A))
>> plotp(orth(A'),'m')

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
3D Arrow with many color/parameter options

MATLAB release MATLAB 7.7 (R2008b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
09 Mar 2011 Hui Shun Huang  
Please login to add a comment or rating.
Updates
26 Dec 2008

Added "rotatePoints.m" into zip file; file is needed for arrow3D.m (by Shawn Arseneau)

Tag Activity for this File
Tag Applied By Date/Time
plot Calvin Price 19 Nov 2008 14:00:25
plane Calvin Price 19 Nov 2008 14:00:25
3d Calvin Price 19 Nov 2008 14:00:25
subspace Calvin Price 19 Nov 2008 14:00:25
3d Tomasz 28 May 2010 07:06:33
3d Elias 28 Jun 2011 11:49:22
plane shashi 10 Nov 2011 07:21:54
plane Carlos 13 Feb 2012 15:17:58

Contact us at files@mathworks.com