Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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

share|improve this question
1  
What do you mean by "to make the x,y,z values diverge."? –  belisarius Jan 21 '13 at 4:15
1  
Flatten[ Table[{i, j, i^2 + j^2 + RandomReal[{-10, 10}]}, {i, -10, 10, 1}, {j, -10, 10, 1}], 1];? –  belisarius Jan 21 '13 at 4:18
    
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 –  Mun Jan 21 '13 at 4:26
    
maybe a function that add some random values to each point? –  Mun Jan 21 '13 at 4:28
1  
noisydata = # + RandomReal[5, 3] & /@ data;? –  kguler Jan 21 '13 at 4:30

1 Answer 1

up vote 8 down vote accepted
 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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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