How to add random Noise between 2% in the dataset

4 views (last 30 days)
Hello I Hope you are doing well.
I have the following dataset. I Want to add random noise 2% in the data. How can i do that in MATLAB.
I also want to randomly select the noise between 0.5 to 2%.
Can anybody help me in this
  2 Comments
Stephen john
Stephen john on 18 Mar 2022
@Walter Roberson if you share for both methods ,i will be very grateful

Sign in to comment.

Answers (1)

Jeff Miller
Jeff Miller on 17 Mar 2022
Do you mean that you want to multiply each value in the dataset by a random number between 1.005 and 1.02, with all random numbers equally likely in that range? This could be done with something like:
multiplier = 1.005 + rand(size(values))*(1.02-1.005);
values = values *. multiplier;
  5 Comments
Jeff Miller
Jeff Miller on 18 Mar 2022
@Stephen john Sorry I am not following you. Maybe you could give a few numerical examples?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by