Find the difference between non-zero elements
5 ビュー (過去 30 日間)
古いコメントを表示
I am trying to determine the differences between the non zero values in the data attached. I have achieved this using the code below
xdiff = diff(xdup(xdup~=0));
This provides a new array of size (27 x 1 double)
However I would like to map the new delta values to the original array (xdup)by including the original zero values. I understand the new array will be (47 x 1 double) compared to xdup (48 x 1 double. Please see xdiff in the data set as an example of what I want to achieve.
I hope this makes sense?
4 件のコメント
Jan
2014 年 3 月 22 日
It would be useful, if you offer the data in a more convenient way than an XLSX file.
参考
カテゴリ
Help Center および File Exchange で Resizing and Reshaping Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!