anyone pls give me a detailed description of what this code is doing ??? thxx
Ältere Kommentare anzeigen
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 Kommentare
Andrew Newell
am 20 Mär. 2011
Run one line at a time. See what it does. And look at the documentation, e.g., "doc randn".
Oleg Komarov
am 20 Mär. 2011
And format the code with teh code button for improved readability of your post.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Data Type Conversion finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!