10% random noise to an array of values

5 次查看(过去 30 天)
How do I add 10 % random noise to freq = 1:40e3

回答(1 个)

William Smith
William Smith 2018-4-3
Not totally clear what you want, but let's assume
  • you want each element in Frequency (40k elements) to be changed to somewhere between 90% and 110% of it's current value.
  • you want a uniform distribution, not say normally distributed noise.
Then:
multiplier = 0.9 + rand(size(freq)) * 0.2;
answer = freq .* multiplier;

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by