Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matlab problem

  1. Jul 21, 2008 #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?
     
  2. jcsd
  3. Jul 21, 2008 #2
    You're not making at clear what it is that you want to do. First off, I can't see what the command

    Code (Text):

    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 (Text):

    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.
     
  4. Jul 22, 2008 #3
    what of v2= (1.5) * v1
     
  5. Jul 22, 2008 #4
    What about it?
     
  6. Jul 22, 2008 #5
    My mistake..I meant the vector was suppoedly the span of V1 and V2. So would the graph be different or the same?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Matlab problem
  1. Matlab problem (Replies: 1)

  2. Matlab problem (Replies: 0)

  3. MATLAB problem (Replies: 5)

  4. MATLAB problem (Replies: 1)

Loading...