%% Return Logical Vector in Cell Array
% Find the punctuation characters in a character vector. isstrprop returns a logical vector indicating which characters belong to that category. Force isstrprop to return the logical vector in a cell array.

chr = 'A horse! A horse! My kingdom for a horse!'

%

TF = isstrprop(chr,'punct','ForceCellOutput',true)

%
% Find indices for the punctuation marks in chr using TF{1}.

find(TF{1})

% Copyright 2012 The MathWorks, Inc.