time | Calls | line |
---|
| | 169 | function s = getVarOptsStruct(obj,idx,setnames)
|
| | 170 | % s = opts.getVarOptsStruct() gets all the struct options with
|
| | 171 | % default vales, names which have been set, and default
|
| | 172 | % names for any variables without a set names.
|
| | 173 | %
|
| | 174 | % s = opts.getVarOptsStruct(idx,setnames) gets the struct
|
| | 175 | % options with defaults values. If SETNAMES = true, the names
|
| | 176 | % are copied to the struct, otherwise, the names are empty.
|
| | 177 | %
|
| | 178 |
|
< 0.001 | 4 | 179 | C = obj.OptionsStruct.Options;
|
< 0.001 | 4 | 180 | if nargin < 2
|
| | 181 | idx = 1:numel(C);
|
< 0.001 | 4 | 182 | else
|
0.002 | 4 | 183 | idx = obj.fixSelection(idx);
|
< 0.001 | 4 | 184 | end
|
< 0.001 | 4 | 185 | n = numel(idx);
|
< 0.001 | 4 | 186 | types = obj.OptionsStruct.Types;
|
< 0.001 | 4 | 187 | if ~obj.NeedsUniformCheck && numel(idx) > 0
|
| | 188 | % Uniform Options, get the first, and replicate it.
|
| | 189 | s = repmat({getOptsStructWithDefaults(types{idx(1)},C{idx(1)})},1,n);
|
< 0.001 | 4 | 190 | else
|
| | 191 | % get all the options; they might be uniform, might not.
|
< 0.001 | 4 | 192 | s = cell(1,n);
|
< 0.001 | 4 | 193 | for ii = 1:n
|
0.003 | 12 | 194 | s{ii} = getOptsStructWithDefaults(types{idx(ii)},C{idx(ii)});
|
< 0.001 | 12 | 195 | end
|
< 0.001 | 4 | 196 | end
|
< 0.001 | 4 | 197 | if nargin > 2 && setnames
|
| | 198 | % Set the names, obj.Names generates the default
|
| | 199 | % Var1,...,VarN names in place.
|
| | 200 | names = obj.Names;
|
| | 201 | for ii = 1:n
|
| | 202 | s{ii}.Name = names{idx(ii)};
|
| | 203 | end
|
| 4 | 204 | end
|
< 0.001 | 4 | 205 | end
|
Other subfunctions in this file are not included in this listing.