Index: mttroot/mtt/bin/trans/dat22sg.sh ================================================================== --- mttroot/mtt/bin/trans/dat22sg.sh +++ mttroot/mtt/bin/trans/dat22sg.sh @@ -100,15 +100,15 @@ [u_names,y_names,x_names] = ${sys}_struc; ncol = size(${vec}_names)(1); load ("${sys}_odes.dat2"); - nrow = size(MTT_data)(1); + nrow = size(mtt_data)(1); # write Time for r = 1:nrow - write_cell (r-1,0,MTT_data(r,1)); + write_cell (r-1,0,mtt_data(r,1)); endfor if ("${vec}" == "y") offset = 1; elseif ("${vec}" == "x") @@ -115,11 +115,11 @@ offset = size(y_names)(1); endif for r = 1:nrow for c = 1:ncol - write_cell (r-1,c,MTT_data(r,c+offset)); + write_cell (r-1,c,mtt_data(r,c+offset)); endfor endfor EOF } @@ -126,11 +126,11 @@ file=${sys}_odes.sg NX=`mtt_getsize ${sys} x` NY=`mtt_getsize ${sys} y` NTMP=`wc -l ${sys}_odes.dat2 | awk '{print $1}'` -NROW=`expr ${NTMP} - 4` # 4 comment lines in MTT_data +NROW=`expr ${NTMP} - 4` # 4 comment lines in mtt_data { write_project_header # states write_worksheet_header "X_${sys}" ${NX} ${NROW} Index: mttroot/mtt/bin/trans/make_ode2odes ================================================================== --- mttroot/mtt/bin/trans/make_ode2odes +++ mttroot/mtt/bin/trans/make_ode2odes @@ -7,10 +7,14 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.57 2001/04/01 03:38:54 geraint +## Reset row to zero after write to file, ready for subsequent runs. +## Eliminates SIGSEGV in Octave when _ode2odes called multiple times. +## ## Revision 1.56 2001/03/30 15:13:58 gawthrop ## Rationalised simulation modes to each return mtt_data ## ## Revision 1.55 2001/03/27 13:21:59 geraint ## Octave version compatibility for save_ascii_data(_for_plotting). @@ -660,11 +664,11 @@ static int row; if (dump_data) { Matrix written_data = data.extract (0, 0, row-1, data.cols ()-1); - $save_ascii_data_function (file, written_data, "MTT_data"); + $save_ascii_data_function (file, written_data, "mtt_data"); return; } const int nx = x.length (), ny = y.length (); register int col = 0; @@ -682,11 +686,11 @@ row++; if (nrows == row) { #ifdef STANDALONE - $save_ascii_data_function (file, data, "MTT_data"); + $save_ascii_data_function (file, data, "mtt_data"); // cout << data << endl; #else // ! STANDALONE set_global_value ("MTT_data", data); #endif row = 0;