21 Dec 2004
(Updated 28 Dec 2004)
Compress large logical variables to one bit per element, instead of the usual 8.
function bool = isPackedLogical(input)
% Returns one if input data was created by the packLogicals function,
% zero if not. A valid packedLogical is a struct with 3 fields, one
% of which contains a comment saying 'Use unpackLogicals to decompress.'.
%By James R. Alaly
% function bool = isPackedLogical(input)
bool = 0;
if isstruct(input) & ...
isfield(input, 'comment') & ...
isfield(input, 'data') & ...
isfield(input, 'dataSize') & ...
strcmp(input.comment, 'Use unpackLogicals to decompress.')
bool = 1;