Random numbers around y-values

2 ビュー (過去 30 日間)
Niklas Kurz
Niklas Kurz 2020 年 6 月 5 日
コメント済み: Ameer Hamza 2020 年 6 月 7 日
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

採用された回答

Ameer Hamza
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+')
  4 件のコメント
Niklas Kurz
Niklas Kurz 2020 年 6 月 7 日
Just one thing is striking me: if I type x = 1:10 matlab sets all natural numbers between 1:10. What if I want a slower step rate like 0.1 -wise. ?
Ameer Hamza
Ameer Hamza 2020 年 6 月 7 日

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by