kill(all)$

maxima:programming matrix(subsample,submatrix,apply),version 1.0
peter.vlasschaert@gmail.com,15/06/2022

list ⇔ matrix
------------------

list → matrix:

M1:[[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]];

M:apply(matrix,M1);

matrixp(M);

rem : matrix(p), p=predicate , result : true or false

matrix → list :

M2:args(M);

subsample
-------------

first example : subsample
-----------------

select(item):=item[3]>6 and item[3]<15;

select : row predicate
constraint : item[i], i: 1,2,..maxnumbers in a row
----------------------------------------------------------
example : maxnumbers in a row =4, i:1→ 4
----------------------------------------------------------
rem : item[3],third element of the rows of →"M"
          select : use logic operator ( and ,or,....)

subsample(M,select);

result : row ,condition : select

kill(select);

subsample(M,select);

second example : subsample
--------------------

select(item):=apply("+",item) > 20; /*rows*/

→ row : selection

subsample(M,select);

→ column : selection (after the row selection).

p1:subsample(M,select,3,4);

same result : submatrix

p2:submatrix(1,M,1,2);

syntax:submatrix(rows,matrix,colums)

check : result p1,p2

is(p1=p2);

https://maths.cnam.fr/Membres/wilk/MathMax/help/Maxima/maxima_45.html

--------------------------------------------------------------------------------------------------