simple array calculation help

1 Ansicht (letzte 30 Tage)
Mahesh Sadupalli
Mahesh Sadupalli am 23 Apr. 2021
Beantwortet: Cris LaPierre am 23 Apr. 2021
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).

Antworten (1)

Cris LaPierre
Cris LaPierre am 23 Apr. 2021
I suggest going through MATLAB Onramp

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by