www.gusucode.com > mbcexpr 工具箱 matlab 源码程序 > mbcexpr/@cgvariable/addstore.m

    function obj = addstore(obj, storekey, store)
%ADDSTORE Add a new store to a variable
%
%  OBJ = ADDSTORE(OBJ, STOREKEY, STORE) adds the specified store object to
%  the variable, keyed against the given STOREKEY.  If there is a store
%  associated with STOREKEY, this store will be overwritten with the new
%  store object.

%  Copyright 2000-2004 The MathWorks, Inc. and Ford Global Technologies, Inc.


idx = getIndices(obj.BackupGUIDs, storekey);
if idx == 0
    % Append new store
    obj.BackupValue = [obj.BackupValue, {store}];
    obj.BackupGUIDs = [obj.BackupGUIDs, storekey];
else
    % Overwrite current store with this guid
    obj.BackupValue{idx} = store;
end