matlab如何画图实心圆点
时间: 2023-11-19 11:55:51 浏览: 794
在Matlab中,可以使用plot函数来画图,其中可以通过设置Marker属性来指定数据点的形状。要画实心圆点,可以将Marker属性设置为'o',具体代码如下:
```matlab
x = 1:10;
y = sin(x);
plot(x, y, 'o') % 画实心圆点图
```
除了'o',还可以使用其他的Marker属性来画不同形状的数据点,例如'+'表示十字形,'x'表示叉形,'s'表示正方形等等。可以通过设置MarkerFaceColor属性来指定数据点的填充颜色,例如设置为'red'表示填充红色,具体代码如下:
```matlab
x = 1:10;
y = sin(x);
plot(x, y, 'o', 'MarkerFaceColor', 'red') % 画填充红色的实心圆点图
```
相关问题
matlab画图实心圆点
在MATLAB中,可以使用`scatter`函数来绘制实心圆点。以下是一个示例代码:
```matlab
% 创建一组随机的x和y坐标
x = rand(1, 100);
y = rand(1, 100);
% 绘制实心圆点
scatter(x, y, 'filled');
```
在上述代码中,我们生成了一组随机的x和y坐标,然后使用`scatter`函数将这些点绘制为实心圆点。`'filled'`参数用于指定圆点填充为实心。
你也可以通过调整`x`和`y`的值来绘制你想要的实心圆点图形。
matlab中实心圆点
在Matlab中,可以使用plot函数来绘制实心圆点。具体方法是在plot函数中设置Marker参数为'o',并将MarkerFaceColor参数设置为所需的颜色。例如,以下代码将绘制一个红色的实心圆点:
```matlab
x = 1:10;
y = rand(1,10);
plot(x,y,'o','MarkerFaceColor','r')
```
阅读全文
相关推荐














