Write a program that will smooth an array of data using an exponential moving average. For the input data we assume a row vector with ๐‘ elements. We use the following expression for the average: Xavg,๐‘˜ = ๐›ผX(๐‘Žv,๐‘˜โˆ’1) + (1 โˆ’ ๐›ผ) โ‹… X๐‘˜, except for ๐‘˜ = 1, where X๐‘Žvg,1 = X1. You can use the following statement (for MATLAB) to create a row vector of data with noise from a normal distribution with a mean of 5.0 and a standard deviation of 3.0 to test your program:
1) inputData = 5.0 + 3.0 โˆ— ๐‘Ÿandn(1,100);
2) ๐›ผ= 0.8
Please use only basic operators like assignment, comparison, conditional statement, and loops. Do not use built in functions or advanced possibilities of a specific programming language (e.g. vectorization in MATLAB).

๋‹ต๋ณ€ (1๊ฐœ)

Cris LaPierre
Cris LaPierre 2021๋…„ 4์›” 23์ผ

0 ๊ฐœ ์ถ”์ฒœ

I suggest going through MATLAB Onramp

์นดํ…Œ๊ณ ๋ฆฌ

๋„์›€๋ง ์„ผํ„ฐ ๋ฐ File Exchange์—์„œ Multidimensional Arrays์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์•Œ์•„๋ณด๊ธฐ

ํƒœ๊ทธ

์งˆ๋ฌธ:

2021๋…„ 4์›” 23์ผ

๋‹ต๋ณ€:

2021๋…„ 4์›” 23์ผ

Community Treasure Hunt

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

Start Hunting!

Translated by