Question: Creating mpl files automatically

Hi everyone,

I created a procedure "SIM" which depends on two formal parameters x and y. I write Threads:-Map(SIM, x, y) in order to execute it with the Threads package.

I would like to create .mpl files automatically, each one made of the code Threads:-Map(SIM, x, y) with specific values of x and y. For instance:

Threads:-Map(SIM, 5000, 1), then Threads:-Map(SIM, 5000, 2) ... and so on until Threads:-Map(SIM, 5000, 5000).

The fact is, I tried writing the following:

for y from 1 to 5000 do
a[y] := Threads:-Map(SIM, 5000, y);
save a[y], sprintf("SIM_%d.mpl", y)
end do

However, it does not work. The error message says "Error, save can only save names". I also tried, but without success:

for y from 1 to 5000 do
a[y] := Threads:-Map(SIM, 5000, y);
save convert(a[y], name), sprintf("SIM_%d.mpl", y)
end do

Any idea? Thanks a lot.

 

 

Please Wait...