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

  • Context: MATLAB 
  • Thread starter Thread starter theBEAST
  • Start date Start date
  • Tags Tags
    Matlab Plot Point
Click For Summary

Discussion Overview

The discussion revolves around a MATLAB plotting issue where a user encounters a straight line instead of a point when plotting a column vector. The conversation explores potential solutions and methods for visualizing points in MATLAB plots, particularly in the context of a specific assignment.

Discussion Character

  • Technical explanation, Homework-related

Main Points Raised

  • One participant describes their issue with plotting a column vector and asks for help in resolving it.
  • Another participant suggests using the 'o' marker to display points instead of lines in the plot.
  • A subsequent reply reiterates the suggestion to use the 'o' marker but notes that the original poster must plot the column vector obtained from a calculation, which they have not detailed.
  • Another participant proposes plotting individual elements of the column vector to achieve the desired point representation.

Areas of Agreement / Disagreement

Participants present multiple approaches to the problem, but there is no consensus on the best solution, as the original poster's constraints are acknowledged but not fully resolved.

Contextual Notes

The discussion highlights limitations related to the original poster's assignment requirements and their unfamiliarity with extracting numbers from the column vector.

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: 631
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, :))
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 32 ·
2
Replies
32
Views
4K
  • · Replies 12 ·
Replies
12
Views
7K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K