selecting non-nan sections of a data series
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 ANOVA 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!