www.gusucode.com > mbcexpr 工具箱 matlab 源码程序 > mbcexpr/+cgsimfill/@Table/updateOptimTable.m

    function updateOptimTable(T,message)
%updateOptimTable stamps table history and resolves history
%
% updateOptimTable(T)

%  Copyright 2005-2013 The MathWorks, Inc.

if nargin<2
    message= 'Optimized';
end
LT= T.Object;

V = get(LT,'values');
% set extrapolation mask
M= false(size(V));
M(T.Indices)= true;

LT= clearExtrapolationMask(LT);
if ~all(M(:))
    [Rows,Cols]= find(M);
    LT= addToExtrapolationMask(LT,Rows,Cols);
end

if T.Extrapolate
    message = sprintf('%s and extrapolated',message);
end
% update table values with history
LT = set(LT, 'values', {V, message});

if T.Extrapolate
    M= getExtrapolationMask(LT);
    if ~isempty(M) && ~all(M(:)) && any(M(:))
        % only extrapolate
        LT= extrapolate(LT);
        % remove last item from history so the Fill message shows
        mem = get(LT,'memory');
        set(LT,'memory',mem(1:end-1));
    end
end

T.Object= LT;