Not a question at all about MATLAB. But I have a few moments to answer.
When do you add uniform noise versus normal? A simple rule is that noise is almost NEVER uniform. Noise typically results from many small tiny things happening at random. They add up, and according to the law of large numbers, the result is something that looks vaguely normal. So most of the time the noise in your data is Normal (Gaussian).
There are some scenarios where noise would be uniformly distributed. One common one is where your data is rounded. That is, imagine this scenario...
ydata = round(ytruth,1)
ydata =
0.8000 0.9000 0.1000 -0.8000 -1.0000 -0.3000 0.7000 1.0000 0.4000 -0.5000 -1.0000 -0.5000 0.4000 1.0000 0.7000 -0.3000 -1.0000 -0.8000 0.1000 0.9000 0.8000 0 -0.8000 -0.9000 -0.1000 0.8000 1.0000 0.3000 -0.7000 -1.0000
So we have a sine wave, but the data is in error. The rounding operation introduces almost pseudo-random uniform noise. (Though it is not random at all.) But this noise will now be approximately uniformly distributed over the interval [-0..05,0.05].
histogram(ytruth-ydata,11,'norm','pdf')
This case is, however, an unusual one. Normally noise is never uniform. Yes, uniform distributions have many uses, but normal in some form is always way more common. One other common case would be a lognormal, but that is just a variation of a normal, in a proportional error context. As far as the case of white noise or not, that just depends upon the situation. Is there some dependency on time that can arise? If so, then the noise will not be white.