Values of an array should be equal to or greater than the value before - values of array in relation to one another
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi !
So I am working on a project for a final, wherein we are to write a MATLAB program to visualize the global COVID-19 pandemic spread, and predict the situation over the next month. The first step of this project is fixing inacurrate entries within the data sets. The instructions are as follows:
The original data files have noises, or inaccurate entries. For example, the confirmed cases should not ever decrease for a particular region, because it is supposed to be the total number of cases up to each date. The same is true for the number of deaths and recovered cases. Identify and correct those inaccurate entries. You can use interpolation to find the best estimation of those erroneous data.
I am confused as to how to write a code that will determine if a value within the each row of the array is not greater than or equal to the value before it. Thank you!
0 comentarios
Respuestas (1)
Isiah Pham
el 8 de Mayo de 2020
So if I have a matrix of cases = [1:10,9], you can use a for loop to go through each number in the matrix and check that it is greater than the previous number.
To predict what the value should be, you can make a polynomial that would fit your data using the function polyfit(xdata, ydata, n). N is the degree of the polynomial, and polyfit creates a polynomial with that degree that would best fit the data. With the polynomial, you can use polyval() to get the interpolation with the regression equation.
0 comentarios
Ver también
Categorías
Más información sobre Polynomials en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!