ContentsIndexReferenceHome
PreviousUpNext
VaryStruct
MATLAB
Strct = VaryStruct(StrctIn,Var1,Var1Values,Var2,Var2Values,...)
Description

Create an array of structures from the input structure given a vector of values to be set, or set fields in an array of input structures. Any substructures referenced in VarN must be present in the input structure, but scalar fieldnames need not be present. All variables must have the same number of values, and must be the same length as the input structure, if it is an array.

Parameters
Parameters 
Description 
StrctIn [struct/array] 
Structure or array of structures 
Var1...VarN [string/cell] 
String or cell array of strings identifying fields within StrctIn to be changed 
VarNValues [array/cell array] 
Values for the specified fields in the input structure. 
Return Values
Return Values 
Description 
Strct [struct array] 
Array of structures, one element per value specified 
Examples

>> P = ParamStruct; 

>> P = VaryStruct(P,'Tx.TRK.BW',[10;50;100;200]) 

  • Vary track bandwidth from 10 Hz to 200 Hz
>> T = LinkTerms(CaseStruct(ParamStruct,GeomStruct,TargStruct,AtmStruct)) 

>> T = VaryStruct(T,'Loss.MyLoss',ones(size(T))) 

  • Add a term MyLoss to the Loss substructure in each T
 

Group
Made with Doc-O-Matic.
Copyright (c) 2009. All rights reserved.
What do you think about this topic? Send feedback!