The output of regexp results in empty cells, if there is no match. To circumvent this I added the 'isempty' – to allow my code just check the matches. Is there a way to merge the regexp with isempty?
For example, the regexpi(varargin,'^.+(\.ppt|\.pptx)$','match') will give:
{1×1 cell} {}
for test = regexpi(varargin,'^.+(\.ppt|\.pptx)$','match') if ~isempty(cell2mat(test{1})) boOutput = cell2mat(test{1}); endend
Best Answer