2
votes

I am plotting a graph as plot(m,n,'o'). In this graph, graph i again need to plot a line between 2 points.

Already tried:

plot(m,n,'o',[10 10],[100 70])

The second part is just giving me the points .What i need is a straight line that connects the 2 points.

1
what is in m and n? - Dan

1 Answers

2
votes

I think you're looking for:

m = 1:10;
n = rand(1,10);
plot(m,n, '-o')   % plot a normal line and circles at marker points

the '-o' is a combination of:

  • '-' defines a normal line
  • 'o' that defines circles at marker points.