How to split tall array with logical array?

조회 수: 4 (최근 30일)
Mathias
Mathias 2017년 11월 15일
Hi everyone,
I have a tall array with measured data 'Output.uniData'. Via a filter i select different value ranges for the measured channels. For Example:
Setup.Selection(1).name = 'Chan7';
Setup.Selection(1).range = [1 100 ; 301 400]; % (>=1 & <=100) | (>=301 & <=400)
Setup.Selection(2).name = 'Chan5';
Setup.Selection(2).range = [1 200];
After checking the conditions and Logical operations i get a Logical tall Array 'Output.selectedLines' where every matching line is true.
In non-tall application then i would do something like this to store each block of trues in a separate file:
% evaluation areas
tempRange=[];
tempRange(:,1)=find(diff([false; Output.selectedLines; false],1,1)==1); % start of blocks
tempRange(:,2)=find(diff([false; Output.selectedLines; false],1,1)==-1); % end of blocks
% tempRange(:,1)=find(diff([tall(false); Output.selectedLines; tall(false)],1,1)==1); % doesnt work cause of find
% tempRange(:,2)=find(diff([tall(false); Output.selectedLines; tall(false)],1,1)==-1);
tempRange(end,:)=[];
for range=1:size(tempRange,1)
Head=Output.uniHeader;
Data=Output.uniData(tempRange(range,1):tempRange(range,2),:);
save(['file_' sprintf('%03d', range) '.mat'],'Data','Head');
end
Unfortunately it doesnt work on tall Arrays cause find is not supported.
Undefined function 'find' for input arguments of type 'tall'.
Can anyone give me a hint how to solve this please. Maybe there is also a better function to filter by different value ranges.
Thanks a lot

답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by