How do I average a data which runs on a cycle?
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
DebiPrasad
el 24 de Nov. de 2014
Comentada: Thorsten
el 26 de Nov. de 2014
I have a data file that goes like -1 0.2 -0.5 0.15 0 0.143 0.5 0.122 1 0.1234 1 0.233 0.5 0.32 0 0.322 -0.5 1.22 -1 1.333 then cycle 2 which has same x values but different y values . the cylce continues for 100 times. i want to have a average of y values for each x values.so finally i have the average y value
0 comentarios
Respuesta aceptada
John D'Errico
el 24 de Nov. de 2014
It can form the mean y value for each independent x. It could even be used to compute a standard deviation of y within each x.
3 comentarios
John D'Errico
el 25 de Nov. de 2014
Then you need to tell consolidator that there are two types of points. Thus you have an increasing section and a decreasing one. Flag each point with a 1 or -1 that indicates which way the cycle is going. Then use consolidator with the 2 dimensional input to distinguish which elements to average.
Más respuestas (1)
Thorsten
el 24 de Nov. de 2014
Editada: Thorsten
el 24 de Nov. de 2014
Read your data into one big 100xN matrix D (e.g., using dlmread) and then use mean(D). Voila.
4 comentarios
Thorsten
el 26 de Nov. de 2014
But in your example you have only x values that run from -1 to 1 and back from 1 to -1. So what do the real data look like? Could you provide the file?
Ver también
Categorías
Más información sobre Spreadsheets en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!