compute the size of a MapleMatrix or MatlabMatrix using MATLAB(R) - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Numerical Computations : Matlab : Matlab/size

Matlab[size] - compute the size of a MapleMatrix or MatlabMatrix using MATLAB(R)

Calling Sequence

size(X)

Parameters

X

-

MapleMatrix, or MatlabMatrix

Description

• 

The size command computes the size of a matrix using MATLAB®.

• 

Executing the size command returns an integer list with n elements for an n-dimensional object.  For example, a three-by-four matrix is two-dimensional, and returns a list with two elements. Each element represents the size of the corresponding dimension. The three-by-four matrix returns the list [3, 4].

• 

To compute the size of a Maple variable, you should use Matlab[dimensions]. Calling size when X is a Maple variable causes X to be copied into the MATLAB® memory space before the MATLAB® size command is called. If X is already a MATLAB® variable (that is, X is a string), then the size is immediately and efficiently computed.

Examples

Setting two Maple matrices.

withMatlab:

maplematrix_a:=Matrix2,3,1,2,3,3,4,5

maplematrix_a:=123345

(1)

maplematrix_b:=Matrix8,7,6,3,2,1

maplematrix_b:=876321

(2)

The size of these matrices in Maple is computed as

Matlab[dimensions]maplematrix_a

[2, 3]

Matlab[dimensions]maplematrix_b

[3, 2]

The matrices are set in the MATLAB® session

Matlab[setvar]matlabmatrix_a,maplematrix_a

Matlab[setvar]matlabmatrix_b,maplematrix_b

Matlab[size]maplematrix_a

[2, 3]

Matlab[size]maplematrix_b

[3, 2]

The product of maplematrix_a*maplematrix_b is computed in MATLAB® and the result is assigned to matlabmatrix_c. The size of the new matrix is determined with the Maple call.

Matlab[evalM]matlabmatrix_c=matlabmatrix_a*matlabmatrix_b

Matlab[size]matlabmatrix_c

[2, 2]

See Also

LinearAlgebra[Dimension], Matlab, Matlab[getvar], Matlab[setvar], MatlabMatrix


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