please help me with this question i couldn't understand it at all

조회 수: 2 (최근 30일)
·Create Step function f with a size of 2000 (1000 samples of zeros and 1000 samples of ones).
Hint: (use zeros and ones functions in matlab)
·Add a noise using randn
·Create a smoothing kernel h of [1, 1, 1, 1, 1]
Filter f with h and plot smoothed function g

채택된 답변

Image Analyst
Image Analyst 2018년 12월 29일
By size I think it means amplitude. So it would be something like
f = [zeros(............ , 200 * ones(.........
f = f + randn(.....................)
h = ......
g = conv(.......)
plot(g, 'b-', 'LineWidth', 2)
grid on;
Since this is your homework, finish it yourself. It's really trivial.
If you still need help, see this link
  댓글 수: 3
Image Analyst
Image Analyst 2018년 12월 29일
I'll do a little more but you really need to make an effort. I mean they literally tell you what h is in the question itself. Did you even look at the help for randn() and conv() or not?
f = [zeros(1, 1000), 200 * ones(...., .....)];
f = f + amplitude * randn(1, length(f));
h = [1, 1, 1, 1, 1];
g = conv(f, h, '....')
plot(g, 'b-', 'LineWidth', 2)
grid on;
amplitude is basically how much noise you want to add to f. Try different numbers from 1 to 100 or so.
There are literally only 9 characters left for you to type in, plus one line of code to assign amplitude. I've done the bulk of it for you (against forum guidelines).
If I do the last few characters, then you would be turning in my homework as your own and that would likely get you into ethical problems with your university. What I've done so far might even be too much. Be very wary of asking for homework solutions and turning them in since I've heard some professors use plagiarism detection software.
anteneh  tadesse
anteneh tadesse 2018년 12월 29일
am really thankfull. thank you

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by