Random numbers around y-values
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Niklas Kurz
am 5 Jun. 2020
Kommentiert: Ameer Hamza
am 7 Jun. 2020
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 Kommentare
Akzeptierte Antwort
Ameer Hamza
am 6 Jun. 2020
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+')
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Line Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!