Question: loop to save file problem (cat command)

Hi,

Have a look at the following

+++++++++++++++++++++++++++++

test:=proc(s::string)
local M,a;
a:=rand(10..100)();
M:= Matrix([a-1,a,a+1]);
ExportMatrix(cat("Matrix_",s),M);
end proc;

+++++++++++++++++++++++++++++

test("1");test("2");test("3");test("4");test("5");test("6");

+++++++++++++++++++++++++++++

it saves in file

Matrix_1, Matrix_2,Matrix_3 .....Matrix_6

 

however,

for i from 30 to 40 do
test("i");
od;

 

ONLY saves in one file

Matrix_i

 

Is this a bug?

or how to do it properly?

 

Thanks.

 

casper

Please Wait...