Error Messages/40835

< Error Messages
Revision as of 19:12, 5 April 2016 by Bbecane (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Error message

The value passed to the vector parameter, 'Set1', of function 'Union' has more than one dimension, 
so that it is ambiguous which index should be the vector dimension.

Cause

A parameter of the function you are calling is declared using the Vector qualifier, such as in this User-Defined Function declaration:

Function Union(Set1, Set2: Vector)

You then attempted to pass a 2-D (or >2-D) array as one of the parameters, e.g.:

Variable A -- {is indexed by I and J}
Variable C := Union(A, B)

Analytica issues this error because it is ambiguous which dimension you intend to be the "vector" dimension -- it might be I or it might be J. Hence, this is ambiguous.

Remedy

You can "vectorize" your variable in the expression that calls the function. For example, suppose we intended the J dimension of A to be the vector dimension (and we'll assume B is already 1-D), you could do this:

Var AJ[J] := A Do Union(AJ, B)

This declares AJ to be dimensioned only by J when the call is made, so it is clear that Union should operate over the J dimension of A.

See Also

Comments


You are not allowed to post comments.