Changeset 6615
- Timestamp:
- 11/17/10 15:59:14 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk/src/m/qmu/preqmu.m ¶
r6568 r6615 43 43 44 44 %expand variables and responses 45 variables=expandvariables(md, md.variables);46 responses=expandresponses(md, md.responses);45 variables=expandvariables(md,variables); 46 responses=expandresponses(md,responses); 47 47 48 48 %go through variables and responses, and check they don't have more than md.npart values. Also determine numvariables and numresponses{{{1 … … 52 52 field_name=variable_fieldnames{i}; 53 53 fieldvariables=variables.(field_name); 54 if numel(fieldvariables)>md.npart, 55 error('preqmu error message: one of the expanded variables has more values than the number of partitions (setup in md.npart)'); 54 for j=1:numel(fieldvariables) 55 if strncmpi(fieldvariables(j).descriptor,'scaled_',7) && str2int(fieldvariables(j).descriptor,'last')>md.npart, 56 error('preqmu error message: one of the expanded variables has more values than the number of partitions (setup in md.npart)'); 57 end 56 58 end 57 59 numvariables=numvariables+numel(variables.(field_name)); … … 63 65 field_name=response_fieldnames{i}; 64 66 fieldresponses=responses.(field_name); 65 if numel(fieldresponses)>md.npart, 66 error('preqmu error message: one of the expanded responses has more values than the number of partitions (setup in md.npart)'); 67 for j=1:numel(fieldresponses) 68 if strncmpi(fieldresponses(j).descriptor,'scaled_',7) && str2int(fieldresponses(j).descriptor,'last')>md.npart, 69 error('preqmu error message: one of the expanded responses has more values than the number of partitions (setup in md.npart)'); 70 end 67 71 end 68 72 numresponses=numresponses+numel(responses.(field_name)); … … 76 80 %build a list of variables and responses descriptors. the list is not expanded. {{{1 77 81 variabledescriptors={}; 78 variable_fieldnames=fieldnames(md.variables );82 variable_fieldnames=fieldnames(md.variables(options.ivar)); 79 83 for i=1:length(variable_fieldnames), 80 84 field_name=variable_fieldnames{i}; 81 variabledescriptors{end+1}=md.variables.(field_name).descriptor; 85 fieldvariables=md.variables(options.ivar).(field_name); 86 for j=1:numel(fieldvariables) 87 variabledescriptors{end+1}=fieldvariables(j).descriptor; 88 end 82 89 end 83 90 84 91 responsedescriptors={}; 85 response_fieldnames=fieldnames(md.responses );92 response_fieldnames=fieldnames(md.responses(options.iresp)); 86 93 for i=1:length(response_fieldnames), 87 94 field_name=response_fieldnames{i}; 88 responsedescriptors{end+1}=md.responses.(field_name).descriptor; 95 fieldresponses=md.responses(options.iresp).(field_name); 96 for j=1:numel(fieldresponses) 97 responsedescriptors{end+1}=fieldresponses(j).descriptor; 98 end 89 99 end 90 100 %}}}
Note:
See TracChangeset
for help on using the changeset viewer.