? ================== mattrim1 =================== proc mattrim1 mrx fx lx mrxs ; ? ? This procedure extracts the successive columns ? from matrix. Edited by Yoshitsugu Kitazawa ? (2003.11.26). ? ? mrx - original matrix ? fx - the starting column number in mrx ? lx - the ending column number in mrx ? mrxs - stemmed matrix, starting from fx-th column ? in mrx and ending at lx-th column ? ? For example, using this procedure, ? from the following 3 by 4 matrix, we can extract ? the matrix composed of the successive columns ? which start from 2nd column of the 3 by 4 matrix ? and end at 4th column. ? ? load(nrow=3, ncol=5) m35 ; ? 1 2 3 4 5 ? 6 7 8 9 10 ? 11 12 13 14 15 ? ; ? ? The used command is ? ? mattrim1 m35 2 4 m33 ; ? ? print m33 ; ? ? 2 3 4 ? 7 8 9 ? 12 13 14 ? ? --------------------------------------------- local nm tls i nmrx ; mat nm = ncol(mrx) ; if((fx<1) .or. (fx>nm) .or. (lx<1) .or. (lx>nm) .or. (fx>lx)); then ; do ; title "ERROR: procedure mattrim1" ; stop ; enddo ; list(first=nm, last=nm) tls ; dot tls ; local mf1-mf. ; unmake mrx mf1-mf. ; enddot ; do i=fx to lx ; if(i=fx) ; then ; do ; list(first=i, last=i) tls ; dot tls ; mmake nmrx mf. ; enddot ; enddo ; else ; do ; list(first=i, last=i) tls ; dot tls ; mmake nmrx nmrx mf. ; enddot ; enddo ; enddo ; mmake mrxs nmrx ; endproc mattrim1 ; ? ================== mattrim1 ===================