Diff of /inst/hinfsyn.m [80cc21] .. [eff17f]  Maximize  Restore

  Switch to unified view

a/inst/hinfsyn.m b/inst/hinfsyn.m
...
...
125
125
126
## Author: Lukas Reichlin <lukas.reichlin@gmail.com>
126
## Author: Lukas Reichlin <lukas.reichlin@gmail.com>
127
## Created: December 2009
127
## Created: December 2009
128
## Version: 0.3
128
## Version: 0.3
129
129
130
function [K, varargout] = hinfsyn (P, nmeas, ncon, varargin)
130
function [K, varargout] = hinfsyn (P, varargin)
131
131
132
  ## check input arguments
132
  ## check input arguments
133
  if (nargin < 3)
133
  if (nargin == 0)
134
    print_usage ();
134
    print_usage ();
135
  endif
135
  endif
136
  
136
137
  if (! isa (P, "lti"))
137
  if (! isa (P, "lti"))
138
    error ("hinfsyn: first argument must be an LTI system");
138
    error ("hinfsyn: first argument must be an LTI system");
139
  endif
139
  endif
140
  
140
  
141
  if (nargin == 1 || (nargin > 1 && ! is_real_scalar (varargin{1})))    # hinfsyn (P, ...)
142
    [nmeas, ncon] = __tito_dim__ (P);
143
  elseif (nargin >= 3)                          # hinfsyn (P, nmeas, ncon, ...)
144
    nmeas = varargin{1};
145
    ncon = varargin{2};
146
    varargin = varargin(3:end);
147
  else
148
    print_usage ();
149
  endif
150
  
141
  if (! is_real_scalar (nmeas))
151
  if (! is_real_scalar (nmeas))
142
    error ("hinfsyn: second argument 'nmeas' invalid");
152
    error ("hinfsyn: second argument 'nmeas' invalid");
143
  endif
153
  endif
144
  
154
  
145
  if (! is_real_scalar (ncon))
155
  if (! is_real_scalar (ncon))
146
    error ("hinfsyn: third argument 'ncon' invalid");
156
    error ("hinfsyn: third argument 'ncon' invalid");
147
  endif
157
  endif
148
  
158
  
149
  if (nargin > 3 && isstruct (varargin{1}))     # hinfsyn (P, nmeas, ncont, opt, ...)
159
  if (numel (varargin) > 0 && isstruct (varargin{1}))   # hinfsyn (P, nmeas, ncon, opt, ...), hinfsyn (P, opt, ...)
150
    varargin = horzcat (__opt2cell__ (varargin{1}), varargin(2:end));
160
    varargin = horzcat (__opt2cell__ (varargin{1}), varargin(2:end));
151
  endif
161
  endif
152
162
153
  nkv = numel (varargin);   # number of keys and values
163
  nkv = numel (varargin);   # number of keys and values
154
  
164
  

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks