Line | |
---|
1 | function dvar=expandvariables(md,variables)
|
---|
2 |
|
---|
3 | fnames=fieldnames(variables);
|
---|
4 |
|
---|
5 | for i=1:length(fnames)
|
---|
6 |
|
---|
7 | % for linear constraints, just copy
|
---|
8 |
|
---|
9 | if isa(variables.(fnames{i}),'linear_inequality_constraint') || ...
|
---|
10 | isa(variables.(fnames{i}),'linear_equality_constraint' )
|
---|
11 | dvar.(fnames{i})=variables.(fnames{i});
|
---|
12 |
|
---|
13 | % for variables, call the setup function
|
---|
14 |
|
---|
15 | else
|
---|
16 | fhandle=str2func([class(variables.(fnames{i})) '.empty']);
|
---|
17 | dvar.(fnames{i})=fhandle();
|
---|
18 | for j=1:length(variables.(fnames{i}))
|
---|
19 | %call setupdesign
|
---|
20 | dvar.(fnames{i})=QmuSetupVariables(md,dvar.(fnames{i}),variables.(fnames{i})(j));
|
---|
21 | end
|
---|
22 | end
|
---|
23 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.