Plotting Vector in 3D Using Matlab

Click For Summary

Discussion Overview

The discussion revolves around plotting vectors in 3D using MATLAB, specifically focusing on the vectors v1 and v2, their relationship, and how to visualize them effectively. Participants explore the use of the quiver3 function and the concept of vector spans.

Discussion Character

  • Technical explanation, Conceptual clarification, Debate/contested, Mathematical reasoning

Main Points Raised

  • One participant describes their attempt to plot vectors v1 and v2 using the quiver3 function but is uncertain if the output represents the span of the two vectors or just a single line.
  • Another participant questions the clarity of the original request and suggests that quiver3 can plot the vectors from the origin, providing a specific code example for plotting both vectors.
  • A participant mentions the scalar multiplication of v1 to obtain v2 and asks how this affects the graph, indicating a potential misunderstanding of the relationship between the two vectors.
  • Further clarification is sought regarding whether the graph would differ if the intention is to represent the span of v1 and v2.

Areas of Agreement / Disagreement

Participants express uncertainty about the correct use of the quiver3 function and the implications of the relationship between v1 and v2. There is no consensus on how to visualize the span of the vectors or the correct interpretation of the output.

Contextual Notes

There are unresolved questions regarding the definition of the "third line" mentioned in the context of vector spans and how to accurately represent this in MATLAB.

Who May Find This Useful

Individuals interested in MATLAB programming, vector mathematics, and 3D visualization techniques may find this discussion relevant.

phantomprime
Messages
7
Reaction score
0
Didn't know where to put this though its also a math problem..

I have to plot the vector in 3d using matlab

v1=[8;2;-6]
v2=[12;3;-9]

v1 =

8
2
-6


v2 =

12
3
-9


v2= (1.5) * v1

Now I used...quiver3(v1,v2)

It gives me the line though I don't know if that line is the span of the two vectors or is the quiver function just plotting one line. My question is..is there a way to plot v1, v2 and have it calculate and show the third line in 3d in matlab?
 
Physics news on Phys.org
phantomprime said:
Didn't know where to put this though its also a math problem..

I have to plot the vector in 3d using matlab

v1=[8;2;-6]
v2=[12;3;-9]

v1 =

8
2
-6


v2 =

12
3
-9


v2= (1.5) * v1

Now I used...quiver3(v1,v2)

It gives me the line though I don't know if that line is the span of the two vectors or is the quiver function just plotting one line. My question is..is there a way to plot v1, v2 and have it calculate and show the third line in 3d in matlab?

You're not making at clear what it is that you want to do. First off, I can't see what the command

Code:
quiver3(v1, v2)

is supposed to do: It gives me an empty plot.

You say you've got two vectors, v1 and v2; do you want to plot these vectors in 3D? If so, quiver3 will do that for you. For instance, the following code will give you a plot of the two vectors, both of whose tails are at the origin:

Code:
quiver3(0,0,0,8,2,-6)
hold on
quiver3(0,0,0,12,3,-9)
hold off

The first three numbers specify the origin of the vectors, and the remaining three numbers specify the components of the vectors in Cartesian coordinates. Is this what you're looking for? I can't quite figure out what you're talking about when you mention a "third" vector: you've mentioned only two vectors in your statement of the problem.
 
what of v2= (1.5) * v1
 
phantomprime said:
what of v2= (1.5) * v1

What about it?
 
My mistake..I meant the vector was suppoedly the span of V1 and V2. So would the graph be different or the same?
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K