www.gusucode.com > mbcexpr 工具箱 matlab 源码程序 > mbcexpr/@cglookup/setVariables.m
function [saveval, OK, msg] = setVariables(LT, Variables, om) %SETVARIABLES % % [SAVEVAL, OK, MSG] = SETVARIABLES(TBL, VARS, OM) % Set other variables using om. % saveval are the preexisting values for reset purposes. % Copyright 2000-2004 The MathWorks, Inc. and Ford Global Technologies, Inc. OK = 1; msg = []; saveval = []; % get the ranges on the Variables not in the table, and set their values for i = 1:length(Variables) varobj = Variables(i).info; saveval{i} = getvalue(varobj); % get the optmgr for setting the othervariables omseti = get(om,['Set_' getname(varobj)]); % run it [Variables(i).info, cost,tmpOK,tmpmsg] = run(omseti, varobj, []); if ~tmpOK OK = 0; % switch OK to 0 if anything goes wrong msg = [msg tmpmsg]; end end