function A = getData(h, data)
%GETDATA Extracts data from qualit ValueArray
%
%   GETDATA is used to extract data from the quality ValueArray. It checks
%   that the stored quality codes match the conversion table specified in
%   the qualmetadata object.
%
%   Author(s): J.G. Owen
%   Copyright 1986-2003 The MathWorks, Inc.
%   $Revision: 1.1.6.1 $ $Date: 2004/12/26 21:34:38 $

% Cast quality codes back to doubles
data = double(data);

if ~all(ismember(data,h.Code)) && ~all(isnan(data))
    %warning('One or more quality codes are not specified in qualityInfo')
end
if isempty(data) % Don't return any 0xn type arrays, which look strange in displays
    A = [];
else
    A = data;
end
