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


  1. Jan 17, 2006 #1
    Ok, so Ive been given a curve in polar coordinates.

    I came up with a parameterisation:

    But now I have to plot the graph using matlab and I have no idea. Theta lies between 0 and 2pi.

    This is what I put in and got back in matlab:
    >> t=[0:pi/50:2pi]
    ??? t=[0:pi/50:2pi]
    Error: Missing MATLAB operator.

  2. jcsd
  3. Jan 17, 2006 #2


    User Avatar
    Science Advisor
    Homework Helper

    Should that be 2*pi?
  4. Jan 23, 2006 #3
    Thanks Tide. I must still be doing something wrong.

    The graph is archimedes spiral. r= theta

    Heres what Ive tried to do:

    >>syms x y r theta

    I only need to plot from theta= 0-->2pi

    Im really lost.

    Any info on how to do line integrals would also be appreciated.

    Thanks again.
  5. Jan 23, 2006 #4


    User Avatar
    Science Advisor
    Homework Helper

    You need to find the element of arc length along the curve. This should help:

    [tex]ds = \sqrt {dr^2 + r^2 d\theta^2}[/tex]

    which you can easily integrate.
  6. Jan 24, 2006 #5
    Thanks Tide. Im not having trouble doing the maths by hand. I can find line integrals no worries by hand its just that I have no idea how to use matlab.
  7. Jan 24, 2006 #6


    User Avatar
    Science Advisor
    Homework Helper


    Since [itex]r = \theta[/itex] you just need to evaluate the integral

    [tex]\int_{0}^{2\pi} \sqrt{1+\theta^2} d\theta[/tex]

    so look for a MatLab command resembling "int(sqrt(1+x^2), x = 0..2pi)"
  8. Jan 24, 2006 #7
    Thanks for the help again Tide, I think Ive got it all out! Finally!
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook