Help with an exercise
Ältere Kommentare anzeigen
Write a function that given a vector x generates a vector y=sin(x) in which it has added a certain noise (simulating to be typical of the environment). This noise must be of mean 0 and ¼ standard deviation, use the randn() function (doc randn for more information). Graph the original function and the function with added noise, contrast both graphs with different colors. Vary the mean and/or standard deviation on the added noise and analyze the behavior on the graph.
Based on this, I have to do another function that receives this vector, filters it and graphs it by using a formule. My problem is that I don't get how to do this with the code
2 Kommentare
Steven Lord
am 13 Apr. 2022
This sounds like a homework assignment. If it is, show us the code you've written to try to solve the problem and ask a specific question about where you're having difficulty and we may be able to provide some guidance.
If you aren't sure where to start because you're not familiar with how to write MATLAB code, I suggest you start with the free MATLAB Onramp tutorial (https://www.mathworks.com/support/learn-with-matlab-tutorials.html) to quickly learn the essentials of MATLAB.
If you aren't sure where to start because you're not familiar with the mathematics you'll need to solve the problem, I recommend asking your professor and/or teaching assistant for help.
Levi Ackerman
am 13 Apr. 2022
Akzeptierte Antwort
Weitere Antworten (1)
David Hill
am 13 Apr. 2022
x=0:.01:2*pi;
sigma=0.25;
s=sigma*randn(1,length(x));
y=sin(x);
plot(x,y,x,y+s);
Kategorien
Mehr zu Directed Graphs 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!