how to insert rand noise for this?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
filename = 'hafis.CSV';
M = csvread(filename);
N=100;
x=M(:,3);
Y=M(:,4);
N=100;
subplot(2,2,1)
plot (x,Y,'linewidth',2)
title('Arc Signal')
xlabel('TIME')
ylabel('VOLTAGE');
0 commentaires
Réponse acceptée
Adam Danz
le 11 Mar 2019
Modifié(e) : Adam Danz
le 11 Mar 2019
You can use rand() to produce a vector (or matrix/array) of random values between 0:1. I subtracted 0.5 from those random numbers to center them around 0. Then I scaled them by a factor of 2 to demonstrate how to scale the random noise. Then simply add the noise to your data.
xrand = (rand(size(x))-0.5) * 2;
yrand = (rand(size(Y))-0.5) * 2;
plot (x + xrand, Y + yrand, 'linewidth', 2)
By the way, you defined N twice in your code.
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!