source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/extras/@lmi/dellmi.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 1.2 KB
Line 
1function sys = dellmi(F,thelmi)
2%dellmi           (OBSOLETE) Deletes a constraint in an LMI object
3%   
4%    F = DELLMI(F,n)         Delete the n'th LMIs
5%    F = DELLMI(F,'tag')  Delete the LMIs having specified tag
6%
7%    See also   LMI, UPDATELMI
8
9
10% Author Johan Löfberg
11% $Id: dellmi.m,v 1.3 2005/02/04 10:10:26 johanl Exp $
12
13if nargin ~=2
14        error('DELLMI needs two argument')
15end
16
17if ~(isa(F,'lmi') & (isa(thelmi,'double') | isa(thelmi,'char')))
18        error('First argument should be an lmi object and second argument integer or string')
19end
20
21% If indexed using handle, convert to index
22if isa(thelmi,'char')
23        thelmitemp = [];
24        for i = 1:size(F.clauses,2)
25                if strcmp(F.clauses{i}.handle,thelmi)
26                        thelmitemp=[thelmitemp i];
27                end
28        end
29        if isempty(thelmitemp)
30                em = ['LMI ''' thelmi ''' not available.'];
31                error(em)
32        else
33                thelmi = thelmitemp;
34        end
35end
36
37% Checks so that it exist
38if any((thelmi<1)) | any((thelmi>size(F.clauses,2)))
39        em = ['LMI #' num2str(thelmi) ' not available.'];
40        error(em)
41end
42sys = F;
43del_lmi = thelmi(logical(thelmi<=size(F.clauses,2)));
44if ~isempty(del_lmi)
45        keep_lmi = setdiff(1:size(F.clauses,2),del_lmi);
46        sys.clauses = {F.clauses{keep_lmi}};
47    sys.LMIid = sys.LMIid(keep_lmi);
48end
Note: See TracBrowser for help on using the repository browser.