Random numbers around y-values
1 次查看(过去 30 天)
显示 更早的评论
Hello, I've got a set of y-values. I'd like Matlab to plot random numbers around these y-values (max difference:15%). For you info: y values are given in a .txt file (let's say 100x1). Thx in advance
0 个评论
采纳的回答
Ameer Hamza
2020-6-6
Try this
x = 1:100;
y = log(x);
noise = (2*rand(size(y))-1).*0.15.*y;
y_noise = y + noise;
plot(x, y, 'r', x, y_noise, 'b+')
更多回答(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!