ContentsIndexReferenceHome
PreviousUpNext
VectorArgCheck
MATLAB
argsOut = VectorArgCheck(['ndims',ndims],argsIn)
Description

This function takes in a list of arguments and makes them all the same size. If the optional input ndims is one, the outputs will all be either rows or columns based on the first vector input. If ndims is two or unspecified, it will look at the maximum size in dimension 1 (N1) and the max size in dimension 2 (N2) of all the inputs, with the exception of strings. The outputs will be of size N1xN2. Character arrays will not be repeated. If only a single output is specified the outputs will be returned as a cell array.

Parameters
Parameters 
Description 
ndims [list] 
(Optional) Number of non-singleton dimensions for the output. Must specify as 'ndims',scalar,... Defaults to number of non-singleton dimensions found in the 
argsIn [list] 
Comma-separated list of arguments 
Return Values
Return Values 
Description 
argsOut [list/cell] 
Comma-separated list of arguments that have the same length 
Examples

>> NumGeoms = 10; 

>> G = FlyoutGeom(GeomStruct,linspace(0,100,NumGeoms)); 

>> [RP,re] = VectorArgCheck(vertcat(G.RP),LocalEarthRadius(G)) 

  • Outputs will be NumGeoms x 3.
>> Atm = AtmStruct; 

>> [alpha,L,z,Cn2] = VectorArgCheck([1 2 3],Atm.L,Atm.z,Atm.Cn2) 

  • Atm is a scalar structure from AtmStruct. The outputs will be NScreens x 3. Same as VectorArgCheck('ndims',2,[1,2,3],Atm.L,Atm.z,Atm.Cn2)
>> Diam = 1:3; DObs = .25; r0 = [.1 .2 .3]'; 

>> [Diam,DObs,r0] = VectorArgCheck('ndims',1,Diam,DObs,r0) 

  • Output will have one non-singleton dimension, i.e. the size will be 1xN or Nx1 depending on the size of the first vector input
 

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