Help with an exercise
이전 댓글 표시
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
Steven Lord
2022년 4월 13일
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
2022년 4월 13일
채택된 답변
추가 답변 (1개)
David Hill
2022년 4월 13일
x=0:.01:2*pi;
sigma=0.25;
s=sigma*randn(1,length(x));
y=sin(x);
plot(x,y,x,y+s);
카테고리
도움말 센터 및 File Exchange에서 Directed Graphs에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!