1
$\begingroup$

I have a data set(x,y,z) corresponding to a hemisphere, to which I want to add some controlled noise (random values) to make the x,y,z values diverge.

data = Flatten[ Table[{i, j, i^2 + j^2}, {i, -10, 10, 1}, {j, -10, 10, 1}], 1]

The above is a 3 coordinate set (x,y,z) values for a hemisphere. How do I add random noise to it?

Thank you

$\endgroup$
  • 1
    $\begingroup$ What do you mean by "to make the x,y,z values diverge."? $\endgroup$ – Dr. belisarius Jan 21 '13 at 4:15
  • 1
    $\begingroup$ Flatten[ Table[{i, j, i^2 + j^2 + RandomReal[{-10, 10}]}, {i, -10, 10, 1}, {j, -10, 10, 1}], 1];? $\endgroup$ – Dr. belisarius Jan 21 '13 at 4:18
  • $\begingroup$ Ahh sorry.. the above code gives me 3 points = (x,y,z) and I want to add noise to x,y,z, that is some random values (range 0 - 5) to x,y,z $\endgroup$ – Mun Jan 21 '13 at 4:26
  • $\begingroup$ maybe a function that add some random values to each point? $\endgroup$ – Mun Jan 21 '13 at 4:28
  • 1
    $\begingroup$ noisydata = # + RandomReal[5, 3] & /@ data;? $\endgroup$ – kglr Jan 21 '13 at 4:30
8
$\begingroup$
 data = Flatten[Table[{i, j, i^2 + j^2}, {i, -10, 10, 1}, {j, -10, 10, 1}], 1];
 noisydata = # + RandomReal[5, 3] & /@ data;
 Row[{ListPlot3D[data, ImageSize -> 300, BoxRatios -> 1],
   ListPlot3D[noisydata, ImageSize -> 300, BoxRatios -> 1]}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.