Scilab Function

aff2ab - linear (affine) function to A,b conversion

Calling Sequence

[A,b]=aff2ab(afunction,dimX,D [,flag])

Parameters

Description

aff2ab returns the matrix representation of an affine function (in the canonical basis).

afunction is a function with imposed syntax: Y=afunction(X,D) where X=list(X1,X2,...,Xp) is a list of p real matrices, and Y=list(Y1,...,Yq) is a list of q real real matrices which depend linearly of the Xi's. The (optional) input D contains parameters needed to compute Y as a function of X. (It is generally a list of matrices).

dimX is a p x 2 matrix: dimX(i)=[nri,nci] is the actual number of rows and columns of matrix Xi. These dimensions determine na, the column dimension of the resulting matrix A: na=nr1*nc1 +...+ nrp*ncp.

If the optional parameter flag='sp' the resulting A matrix is returned as a sparse matrix.

This function is useful to solve a system of linear equations where the unknown variables are matrices.

Examples

See Also