How to get original values from cumulative sum values?
22 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Stephen23
2022 年 6 月 19 日
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で GPU Computing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!