MATLAB Why Does My MATLAB Plot Show a Line Instead of a Point?

AI Thread Summary
The discussion revolves around a user encountering an issue when plotting a column vector x=[1;1], resulting in a straight line instead of a single point. To display points correctly, the user is advised to use the 'o' marker in the plot command, such as plot(x,y, 'o'). However, the user needs to plot the x column vector derived from a separate calculation, which has not been shared. Suggestions include extracting the numbers from the column vector or using specific indexing commands like plot(x(1),x(2)) for individual elements or plot(x(1,:), x(2,:)) for multiple elements. The conversation emphasizes the importance of correctly formatting the plot command to achieve the desired visual output.
theBEAST
Messages
361
Reaction score
0
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?
 

Attachments

  • Capture.PNG
    Capture.PNG
    10.7 KB · Views: 616
Physics news on Phys.org
Code:
plot(x,y);
where (x,y) is a point.

To show points, also:
Code:
plot(x,y 'o');
 
jhae2.718 said:
Code:
plot(x,y);
where (x,y) is a point.

To show points, also:
Code:
plot(x,y 'o');

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.
 
plot(x(1),x(2));

for multiple elements,
plot(x(1, :), x(2, :))
 
Back
Top