How can I add random noise using the rand function with the noise being uniformly distributed between 0 and 2?

2 Ansichten (letzte 30 Tage)
If I have a new vector z=a1x^2 - a2y^2 + a3xy, how can I add random noise to all the elements in z using the function rand()? The noise needs to be uniformly distributed between 0 and 2.

Antworten (1)

Amit
Amit am 27 Jan. 2014
z=a1*x.^2 - a2*y.^2 + a3*x.*y + 2*rand(size(x));
  5 Kommentare

Melden Sie sich an, um zu kommentieren.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by