%% Plot Regions of Interest from Binary Sequences Mask
% Consider a mask of binary sequences for two categories, ran and dom. Use the sequences to generate a signalMask object. Discard regions with fewer than 3 samples.

rng default

sq = randi(2,200,2)-1;

m = signalMask(sq,"MinLength",3,"Categories",["ran" "dom"]);

%
% Generate a sequence of 200 random numbers. Plot the regions of interest.

x = rand(200,1);

plotsigroi(m,x)

% Plot the regions of interest using rectangular patches.

plotsigroi(m,x,true)

% Copyright 2020 The MathWorks, Inc.