www.gusucode.com > mbcdata 工具箱 matlab 源码程序 > mbcdata/@cgoptimextoptions/getVariableIndex.m

    function idx = getVariableIndex(opts, label)
%GETVARIABLEINDEX Get index of a variable
%
%  IDX = GETVARIABLEINDEX(OPTS, LABEL) returns the index of the variable
%  with the label LABEL in the optimization setup.

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


[unused, idx] = ismember(label, getFreeVariables(opts));