anyone pls give me a detailed description of what this code is doing ??? thxx
Afficher commentaires plus anciens
t=0 : 0.1: 30; x=10*sin (2*pi.*t/20);
figure;plot(t,x,'k','linewidth',2); xlabel('time,s'); ylabel('amplitude');
n=randn(size(t)); xn=x+n;
hold on; plot (t,xn);
wn=-5 : 1 : 5;
xc=xn;
for i = 6 : 1 : length(t) - 5
xc(i) = mean(xn(i + wn));
end
hold on; plot(t,xc,'q','linewidth',2);
2 commentaires
Andrew Newell
le 20 Mar 2011
Run one line at a time. See what it does. And look at the documentation, e.g., "doc randn".
Oleg Komarov
le 20 Mar 2011
And format the code with teh code button for improved readability of your post.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Data Type Conversion dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!