How to get original values from cumulative sum values?
25 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Niraj Bal Tamang
el 19 de Jun. de 2022
Respondida: Stephen23
el 19 de Jun. de 2022
I have a list of cumulative sum values. I want to obtain another list with the values that generated the cumulative sum vaues. Something like a reverse cumulative sum process. I tried (X2-X1) formula for each consecutive value but couldn't get the exact values. Can someone please help me to reverse the cumulative sum values to original values.
Thank you
0 comentarios
Respuesta aceptada
Stephen23
el 19 de Jun. de 2022
X = rand(1,9)
Y = cumsum(X)
Z = [Y(1),diff(Y)]
max(X-Z) % alomsot zero
Because of the accumulated floating point error getting exactly the same values is not expected.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre MATLAB Mobile 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!