%% Extract Signal Regions of Interest
% Consider a two-column matrix representing possible regions of interest of a 45-sample random signal. Extract the signal samples corresponding to the regions of interest.

x = randn(45,1);
 
roilims = [5 10; 15 25; 30 35];

sigroi = extractsigroi(x,roilims);

%
%  Plot the signal and highlight the regions of interest.

plot(x)

hold on
for kj = 1:length(sigroi)
    plot(roilims(kj,1):roilims(kj,2),sigroi{kj})
end
hold off

% Copyright 2020 The MathWorks, Inc.