[http://www.obihiro.ac.jp/~suzukim/masuda/octave/html/octave_20.html#SEC49 参考 GNU Octave: 3.3 size (a,n)]
 size(Z):=block(fn(f):=1,C:matrixmap(fn,col(Z,1)),R:matrixmap(fn,row(Z,1)),
     return(matrix([transpose(C).C,R.transpose(R)])))$
 a:matrix([1,2],[3,4],[5,6]);size(a);
[ftp://ftp.eng.auburn.edu/pub/bhidetm/t/jhelp/techdoc/ref/diag.html  参考 MATLAB Function Reference]
 size(Z):=block(fn(f):=1,C:matrixmap(fn,col(Z,1)),R:matrixmap(fn,row(Z,1)),
      return(matrix([transpose(C).C,R.transpose(R)])))$
 diag(v):=block(n:size(listarray(y))[1,2],
                P:zeromatrix(n,n),
                FOR i:1 THRU n STEP 1 DO P[i,i]:y[i],
                return(P))$
 y[1]:1;y[2]:2;y[3]:3;diag(y);