Back to index

texmacs  1.0.7.15
mat2scm.m
Go to the documentation of this file.
00001 ## Released under the GNU General Public License, see www.gnu.org
00002 ## Copyright (C) 2002 by the Free Software Foundation
00003 ## Written by Michael Graffam mikegraffam@yahoo.com
00004 ##
00005 ## Convert a matrix to a Scheme expression
00006 ## Created: Sept 2002
00007 
00008 function tmp=mat2scm(M)
00009        global TMCOLORS;
00010        global TMCOLIDX;
00011        tmp="(with \"mode\" \"math\" \"math-display\" \"true\" (matrix (tformat (table";
00012        [r,c]=size(M);
00013        for i=1:r
00014               tmp=[tmp,"(row "];
00015               for j=1:c
00016                      tmp1=num2scm(M(i,j));
00017                      tmp=[tmp,"(cell ", tmp1, ") "];
00018               endfor
00019               tmp=[tmp,") "];
00020        endfor
00021        tmp=[tmp,"))))"];
00022 endfunction