Index: mttroot/mtt/bin/trans/dm_r2m ================================================================== --- mttroot/mtt/bin/trans/dm_r2m +++ mttroot/mtt/bin/trans/dm_r2m @@ -12,10 +12,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.3 1996/08/18 12:02:46 peter +## Fixed bug when some matrices are empty. +## ## Revision 1.2 1996/08/12 20:22:20 peter ## Paramaters passed via an internal call to _numpar. ## _args script can overide these parameters - sneaky. ## ## Revision 1.1 1996/08/12 19:09:13 peter @@ -59,22 +62,18 @@ write "% File $1_dm.m"; write "% Generated by MTT"; IF MTTNvar>0 THEN BEGIN - write "% Read in the parameters"; - write "[ ...;;"; + write "% Parameters"; + write "global ...;;"; FOR i := 1:MTTNvar DO BEGIN - IF i ode2odes_m.log +$MATRIX << EOF > ode2odes_m.log 2>mtt_error + + %Read in parameters + $1_numpar; [nx,ny,nu,nz,nyz] = $1_def; t=0; %Just in case it appears in the parameter list. $PARAMS @@ -79,11 +85,24 @@ end; write_matrix([T,y], '$1_odeso'); end; EOF + +err_length=$(wc -c 0 THEN BEGIN write "% Read in the parameters"; - write "[ ...;;"; + write "global ...;;"; FOR i := 1:MTTNvar DO BEGIN - IF i0 THEN -BEGIN - write "function [MTTA,MTTB,MTTC,MTTD] = $1_sm(..."; - FOR i := 1:MTTNvar DO - BEGIN - IF i0 THEN -BEGIN - write "%function [MTTA,MTTB,MTTC,MTTD] = $1_sm(..."; - FOR i := 1:MTTNvar DO - BEGIN - IF i0 THEN BEGIN - write "% Read in the parameters"; - write "[ ...;;"; + write "% Set the parameters"; + write "global ...;;"; FOR i := 1:MTTNvar DO BEGIN - IF i0 THEN BEGIN - write "function [ ...;;"; + write "global ...;;"; FOR i := 1:MTTNvar DO BEGIN - IF i0 THEN BEGIN FOR i := 1:MTTNvar DO @@ -80,11 +75,10 @@ END; END; if MTTNVar=0 THEN write "foo=0"; - SHUT "$1_numpar.m";