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

Homework Help: Need some help with matlab question

  1. Jan 14, 2009 #1
    1. The problem statement, all variables and given/known data
    I have to make a plot with sin(t) (y values) vs cos(t) (x values). The values of t should be between -pi and pi. I'm supposed to use linspace.


    2. Relevant equations



    3. The attempt at a solution
    i used these lines:

    t=linspace(-pi,pi)
    plot(cos(t),sin(t))

    when i tried it out, the plot came out like this:
    2pqnx5i.jpg

    it shouldn't look like this should it? its only showing the plot go from -1 to 1.
     
  2. jcsd
  3. Jan 15, 2009 #2

    CEL

    User Avatar

    If t is a real number, both sin t and cos t have values in the [-1, +1] interval, so your graph is correct (a circle).
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook