coo*_*ool 1 matlab matlab-figure
I can't understand this: when I write the following code I obtain this graph in matlab.
x = [0 1 2 3 4 5];
y = [0 1 0 1 0 1];
figure
plot(x,y);
Run Code Online (Sandbox Code Playgroud)

I had just expected that only the points written in arrays x and y would be plotted ,but the graph shows lines also...
I can't understand why is it so... Please help where am I wrong
Try to use the following
figure(10);
plot(x,y, '.');
figure(20);
plot(x,y, 'x');
figure(30);
plot(x,y, '-r');
Run Code Online (Sandbox Code Playgroud)
See the differences... a dot-scatter, x-scatter and red line plot.
In the plot documentation you can read more about line styles. By default it is a blue line, as you can see in your plot!
| 归档时间: |
|
| 查看次数: |
4812 次 |
| 最近记录: |