Continuous plot(x,y) for discrete data points
33 次查看(过去 30 天)
显示 更早的评论
When using plot(x,y) function, [say for example x = 1X20 matrix and y=sin(x), which means that there are only 20 data points), matlab plot comes out to be a continuous one. Is this always the case? I just started using matlab.
1 个评论
Chandeesh
2022-7-25
Select the functions to represent the graph of a continuous and a discrete function.
采纳的回答
Azzi Abdelmalek
2013-12-30
You can use plot for continuous plot, or stem function for discrete plot. You can also use scatter function
Example
x=0:10
y=sin(x)
plottx,y);
figure
stem(x,y);
figure
scatter(x,y)
更多回答(2 个)
Sean de Wolski
2013-12-30
编辑:Sean de Wolski
2013-12-30
plot is just connecting the points with lines. If you don't want this, you can specify the marker. For example, for a red *
>> plot(0:0.1:2*pi,sin(0:0.1:2*pi),'r*')
And for more info:
doc plot
Anil
2022-12-28
i only have one point for x and y how can i generate a continuous plot for this
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!