selecting non-nan sections of a data series

3 ビュー (過去 30 日間)
Binu
Binu 2020 年 1 月 30 日
コメント済み: Binu 2020 年 1 月 31 日
Hello,
The attached file has some nan values. I want to separate all non-nan data sections and apply low-pass filtering. Can you help me to select non-nan data sections in this txt file, so I can apply filtering for each non-nan data sections separately.
Thank you

採用された回答

Walter Roberson
Walter Roberson 2020 年 1 月 30 日
test = load('test.txt');
mask = ~isnan(test.');
starts = strfind([0 mask], [0 1]);
stops = strfind([mask 0], [1 0]);
Now starts(K) is the index of the first non-nan in a group and stops(K) is the index of the last non-nan in the group.
  1 件のコメント
Binu
Binu 2020 年 1 月 31 日
Thanks Walter. It worked.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeANOVA についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by