Skip to main content

findIsIncludedStartAndEndIndex.m


% This function is part of the NMSM Pipeline, see file for full license.
%
%
%
% (2D Array of number, Array of boolean, integer) -> (integer)
% finds the start index in secondary values depending on isIncluded array


function [startIndex, endIndex] = findIsIncludedStartAndEndIndex( ...
primaryValues, isIncluded, index)
startIndex = 1;
for i=1:index-1
if(isIncluded(i))
length(primaryValues{i});
startIndex = startIndex + length(primaryValues{i});
end
end
endIndex = startIndex + length(primaryValues{index}) - 1;
end