Extracting submatrices with an existing list of indices



On 12/26/08, ferriste at libero.it <ferriste at libero.it> wrote:

>  j[1] : 2;
>  j[2] : 5;
>
>  so there are two columns to delete, the
>  2nd and the 5th.

listarray(a) => list of elements of the undeclared array a

so in this case try:

apply (submatrix, cons (M, listarray (j)));

(apply(foo, ...) is a way to call foo with a constructed list of arguments.)

Hope this helps,

Robert Dodier