How to randomly add variance in a graph plot
显示 更早的评论
I'm graphing y=x, but I want to add a second plot of black stars where y is randomly + or - 0.25 I know the code to plot is
plot (x,y2, 'k*')
but how do I randomly add noise to create y2?
回答(1 个)
Star Strider
2015-9-28
编辑:Star Strider
2015-9-28
0 个投票
Experiment with the randn and rand functions to get the result you want.
2 个评论
Krish Desai
2015-9-28
类别
在 帮助中心 和 File Exchange 中查找有关 2-D and 3-D Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!