Vanguard Software
Forecasting & Planning Solutions

contents.gifindex.gifprev1.gifnext1.gif

Add

Format: A + B

Arguments: [any] A, B Any real numbers, complex numbers, vectors, or matrices to add or text strings to concatenate

Returns: [num] Sum of A and B if both are numbers, vectors, or matrices

(text) A string including A and B concatenated together if either is a text string

Description: This operator serves two purposes: numeric addition if both arguments are numbers, vectors, or matrices, and text concatenation if either of the arguments is a string. When a string is concatenated to a number, the number is first converted into a string using the default number format.

Addition is carried out using one of the following methods as is appropriate for the input data:

If A is an array and B is a number, B is added to every element in A:

  dsc00195.gif

If A is a number and B is an array, A is added to every element in B:

  dsc00196.gif

If both A and B are arrays with the same dimensions, the corresponding elements in A and B are added:

  dsc00197.gif

In all cases, elements are added using complex addition where appropriate:

  dsc00198.gif

Examples: 3+4 = 7

(4+3*I)+(1-I) = 5+2i

[1,2,3,4]+10 = [11,12,13,14]

10+[1,2,3,4] = [11,12,13,14]

[1,2,3,4]+[1,2,3,4] = [2,4,6,8]

[[1,2],[3,4]]+[[1,2],[3,4]] = [[2,4],[6,8]]

"concat"+"enate" = concatenate

"X is "+3+4 = X is 34

"X is "+(3+4) = X is 7

See Also: Plus, Subtract

  Forecasting Software  |  Strategic Planning Software  |  Decision Support Software
Decision Tree Analysis  |  Monte Carlo Simulation Software  |  Risk Analysis Software
Portfolio Analysis  |  Expert System Software  |  Online Forms

Contact Us  |  Terms of Use  |  Privacy Policy  |  Site Map
Vanguard Software
© 2009 Vanguard Software Corporation
Home Products Solutions Services Customers Partners Company
Vanguard
Applying science to business management
Vanguard
Print this page   Email this page to a friend