You can use scatter
function to plot a matrix of points in MATLAB. Here is an example code:
main.m102 chars6 lines
In this example, rand
function is used to create a matrix of 1000 rows and 2 columns with random values between 0 and 1. scatter
function is used to plot the matrix, where the first column of data
matrix is used as x-coordinates and the second column as y-coordinates for the points.
You can also customize the plot by specifying the size, color, and marker style of the points. For example:
main.m109 chars3 lines
In this example, the third argument 10
specifies the size of the markers, 'red'
specifies the color of the markers, 'filled'
specifies that the markers should be filled, and 'square'
specifies the shape of the markers.
gistlibby LogSnag