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

How to plot a point on matlab?

  1. Feb 22, 2012 #1
    I have attached a picture of my problem to this thread. When I plot the column vector
    x=[1;1]
    I get a straight line instead of a point, does anyone know how to fix this?
     

    Attached Files:

  2. jcsd
  3. Feb 22, 2012 #2

    jhae2.718

    User Avatar
    Gold Member

    Code (Text):

    plot(x,y);
     
    where (x,y) is a point.

    To show points, also:
    Code (Text):

    plot(x,y 'o');
     
     
  4. Feb 22, 2012 #3
    Thanks but for this assignment I have to plot the x column vector that I get from doing another calculation that I did not show. Maybe I can extract the numbers out of the column but we have not been taught that.
     
  5. Feb 22, 2012 #4

    jhae2.718

    User Avatar
    Gold Member

    plot(x(1),x(2));

    for multiple elements,
    plot(x(1, :), x(2, :))
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: How to plot a point on matlab?
Loading...