anyone pls give me a detailed description of what this code is doing ??? thxx
Show older comments
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 Comments
Andrew Newell
on 20 Mar 2011
Run one line at a time. See what it does. And look at the documentation, e.g., "doc randn".
Oleg Komarov
on 20 Mar 2011
And format the code with teh code button for improved readability of your post.
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!