Matlab problem

  • MATLAB
  • Thread starter phantomprime
  • Start date
  • #1
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?
 

Answers and Replies

  • #2
422
1
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.
 
  • #3
what of v2= (1.5) * v1
 
  • #5
My mistake..I meant the vector was suppoedly the span of V1 and V2. So would the graph be different or the same?
 

Related Threads on Matlab problem

  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
17
Views
3K
  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
5
Views
2K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
3
Views
2K
  • Last Post
Replies
3
Views
4K
  • Last Post
Replies
2
Views
2K
Top