MATLAB Examples

Plot Only Data Points

This example shows how to plot only the data points by omitting the line style option from the line specification.

Define the data x and y. Plot the data and display a star marker at each data point.

x = linspace(0,2*pi,25);
y = sin(x);

figure
plot(x,y,'*')