I have the following code
SetDirectory["C:\\test"];
fname = FileNameJoin[{%, "results.dat"}];
str = OpenWrite[fname, FormatType -> StandardForm]
D1 = 0.4;
D2start = 0.26; D2fin = 0.5; Ntot = 12;
D2step = (D2fin - D2start)/Ntot;
For[i = 0, i <= Ntot, i++,
D2 = D2start + i*D2step ;
With[{minsol = NMinimize[fnew[D1, D2, x], x]},
fmin = First@minsol;
xn = Values@ Last@ minsol;];
Write[str, D2, " ", xn]; ]
Close[str];
i.e I minimize the function fnew
with respect to x
and write the value of x
in the file results.dat. The problem is that the output is
0.26 {0.711259}
0.28 {0.744881}
0.3 {0.776204}
0.32 {0.805418}
...
How do I get rid of these annoying curly brackets?