www.gusucode.com > mbcview 工具箱matlab源码程序 > mbcview/@cgoptimnode/replacekey.m

    function [newkey,pInt]= replacekey(OPT,ProjA)
%REPLACEKEY replace GUID
% 
% newkey= replacekey(OPT,ProjB)

% Copyright 2005 The MathWorks, Inc. and Ford Global Technologies, Inc.


% this assumes cgoptim isa mbcreference!!!
ind= find(ProjA.pNode==address(OPT));

% is this the best way to get all the base variables?
src= getSource(ProjA,ind);
pVars= ProjA.pData(src);

pData= getdata(OPT);

[pData.info,newkey,pInt]= replacekey(pData.info,pVars);