www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/@mbcwidgets/@VariableEditorTable/getValueColumn.m

    function [Values, Types] = getValueColumn(obj, ColumnName)
%GETVALUECOLUMN Get the values from specified columns.
%
%   VALUES = GETVALUECOLUMN(OBJ, COLUMN) returns a cell array of values for
%   all variables, for the value columns whose names match the cell array
%   of strings in COLUMN.
%
%   [VALUES, TYPES] = GETVALUECOLUMN(...) also returns a matrix containing
%   the value type codes for the values.

%   Copyright 2007 The MathWorks, Inc.

Cols = obj.ValueColumnHeader;
[unused, idx] = ismember(ColumnName, Cols);

Values = obj.VariableValues(:, idx);
if nargout>1
    Types = obj.VariableTypes(:, idx);
end