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.

请先登录,再进行评论。

更多回答(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