How to split tall array with logical array?

1 次查看(过去 30 天)
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