0
$\begingroup$

This question already has an answer here:

I'm using some parameters to determine the elements of a list. I want to save this list with DumpSave, but I need to name it with its parameters. For example, I use the following parameters

>a=1;

>b=5;

c=12;

and the list is determined by

Q=Table[f[i,j,k],{i,a},{j,b},{k,c}];(*this is just an example*)

Then, I want to save Q with DumpSave in the following way

DumpSave["1-5-12.mx",{Q}](*of the form "a-b-c.mx"*)

and then, it would be opened with,

<<DumpSave[1-5-12.mx]

I want to automatize the saved process. Do you know how to do that?

$\endgroup$

marked as duplicate by Sjoerd C. de Vries, Community Jul 23 '15 at 12:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3
$\begingroup$
a = 1;
b = 5;
c = 12;

(* version 10 *)
StringTemplate["`1`-`2`-`3`.mx"][a, b, c]
(* "1-5-12.mx" *)

(* 10 and lower *)
StringJoin @@ Riffle[ToString /@ {a, b, c}, "-"] <> ".mx"
(* "1-5-12.mx" *)
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.