Removing leading values in a matrix
古いコメントを表示
I am using the findchangept function ('std') on the below time series. The first 23 values are 0, which gets marked as the changepoint by the function (left plot). If I detect the first non-zero entry (find(x, 1)) and then analyse the data from that point onward that function works much better (right plot). My problem is in replicating this across a large matrix of data.
The matrix is 200x10000, but the first non-zero entry varies by row. I don't know how to adjust the matrix so that each row is of a different length. I'm actually using the data in a cell framework so:
%first non_zero point in each cell
first_non_zero = cellfun(@(x)(find(x, 1)), example_cell);
This yields a 200 x 1 matrix.
example_cell_adjust (i) = example_cell (i, (first_non_zero(i): end));
This doesn't work but shows what I want, a set of vectors of unequal length that I can then run the findchangept function on.
Or maybe there is a better way of using the findchangept function so that it doesn't trip on the first zero to non-zero point.
Thanks.

採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Descriptive Statistics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!