ArrayTools - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Low-level Manipulation : Matrices, Vectors, and Arrays : ArrayTools : ArrayTools/AddAlongDimension

ArrayTools

  

AddAlongDimension

  

add the elements of an Array

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

AddAlongDimension(A,dim)

Parameters

A

-

Array

dim

-

(optional); dimension to add along

Description

• 

The AddAlongDimension(A) command adds up the elements in dimension dim of a N-dimensional Array to produce an Array with (N-1) dimensions.

• 

When dim is not specified, the first non-singleton dimension is used for adding.  If the dimension specified is a higher dimension than the number of dimensions in the input, the input itself will be returned.  

• 

If AddAlongDimension is applied to a Vector, a constant will be returned.

• 

This function is part of the ArrayTools package, so it can be used in the short form AddAlongDimension(..) only after executing the command with(ArrayTools. However, it can always be accessed through the long form of the command by using ArrayTools[AddAlongDimension](..).

Examples

withArrayTools:

MMatrixa,b,c,d,e,f

M:=abcdef

(1)

AddAlongDimensionM,1

a+db+ec+f

(2)

AddAlongDimensionM,2

a+b+cd+e+f

(3)

vVector1,2,3,4

v:=1234

(4)

AddAlongDimensionv

10

(5)

See Also

ArrayTools

ArrayTools[MultiplyAlongDimension]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam