📄 subsref.m
字号:
function X = subsref(quiz,s)% SDMPB/SUBSREF - Get the structure or the value of some variable%% Xval = quiz (VARindex)%% gives the value of the variable X referenced by <VARindex>% once SDMSOL was run on the SDMPB object%% Xdec = quiz {VARindex} % % gives the structure of the variable X referenced by <VARindex>% Xdec is a matrix of same size as the variable% and reads as follows (where i=sqrt(-1)) % Xdec(k,j)= 0 if X(k,j)=0% Xdec(k,j)= +n if X(k,j) real = n-th decision variable % Xdec(k,j)= -n if X(k,j) real = (-1)*n-th decision variable% Xdec(k,j)= +n+n*i if X(k,j) complex = n-th decision variable % Xdec(k,j)= -n-n*i if X(k,j) complex = (-1)*n-th decision variable % Xdec(k,j)= +n-n*i if X(k,j) complex = conjugate n-th decision variable % Xdec(k,j)= -n-n*i if X(k,j) complex = (-1)*conjugate n-th decision variable %% SEE ALSO sdmpb/get % This file is part of SeDuMi Interface 1.04 (JUL2002)% last update 4th July 2002 % Copyright (C) 2002 Dimitri Peaucelle & Krysten Taitz% LAAS-CNRS, Toulouse, France% % This program is free software; you can redistribute it and/or modify% it under the terms of the GNU General Public License as published by% the Free Software Foundation; either version 2 of the License, or% (at your option) any later version.% % This program is distributed in the hope that it will be useful,% but WITHOUT ANY WARRANTY; without even the implied warranty of% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the% GNU General Public License for more details.% % You should have received a copy of the GNU General Public License% along with this program; if not, write to the Free Software% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. if s.type=='.' error(sprintf([... 'Specify index of the variable as\n'... ' quiz(VARindex) to get the variable value computed by SeDuMi\n'... ' quiz{VARindex} to get the structure of decision variables'])); end; if length(s.subs)>1 error('call for one subscript at a time'); elseif ~isnumeric(s.subs{1}) error('subscript must be an integer'); elseif max([1,1]~=size(s.subs{1})) error('subscript must be an integer'); elseif round(s.subs{1})~=s.subs{1} error('subscript must be an integer'); elseif s.subs{1}<=0 error('subscript must be strictly positive'); elseif s.subs{1}>quiz.var.nb error('subscript exceeds number of variables in the problem'); else ii=s.subs{1}; switch s.type case '()' X=get(quiz,'varvalue',ii); case '{}' X=get(quiz,'vardec',ii); otherwise error(sprintf([... 'Specify index of the varaible as\n'... ' quiz(VARindex) to get the variable value computed by SeDuMi\n'... ' quiz{VARindex} to get the structure of decision variables'])); end end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -