matlab中画一个点
时间: 2024-05-19 19:09:44 浏览: 131
在 MATLAB 中,你可以使用 plot 函数来绘制一个点。你需要提供该点的 x 和 y 坐标。以下是一个示例代码:
```matlab
x = 1;
y = 2;
plot(x, y, 'o')
```
在这个例子中,我们定义了变量 x 和 y,它们分别表示点的 x 和 y 坐标。然后,我们使用 plot 函数将该点绘制出来。最后一个参数 'o' 表示使用圆圈来绘制该点。
如果你想绘制多个点,可以在 x 和 y 中分别提供一组坐标。例如:
```matlab
x = [1, 2, 3];
y = [2, 4, 6];
plot(x, y, 'o')
```
这将绘制三个点:(1,2),(2,4) 和 (3,6)。
阅读全文
相关推荐












