how to add noise to my data

Hello. Suppose that I have a sensor connected to my unmanned air vehicle, that measures the height of the each point it sees on the surface. The sensor measures with %1 error, such as adding random noise to the actual height value. How can I generate such a data, say 500 values each of which is generated by %1 error?

Answers (2)

Azzi Abdelmalek
Azzi Abdelmalek on 14 Feb 2013
Edited: Azzi Abdelmalek on 14 Feb 2013
Example
t=0:0.1:100
y=sin(0.1*t) % Your signal
yd=y+rand(1,numel(y)).*y/100 % diturbed signal
plot(t,y,'r',t,yd,'g')
er=abs((yd-y)./y)
piyawat
piyawat on 2 Feb 2023
hello , i have a dataset that i want to add noise into to simulate how differential privacy works in smart metering. Do anyone know how i can achieve this thanks.

Asked:

on 14 Feb 2013

Commented:

on 3 Feb 2023

Community Treasure Hunt

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

Start Hunting!