Please help me, dear experts
I am using for loop to calculate a set of output with different parameter value in 'a'.
a = {1.2, 2.2, 3.2, 4.2};
for diff value of a, I need to output a file. totally 4 output files as following:
" output_a1.out", " output_a2.out", " output_a3.out" and " output_a4.out"
and each file include 5000 pairs of x, y data.
many many thanks to you guys.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
main()
{
a = 1.2;
for (N=1;N<5000;N++)
{
Y[N] = X[N]+sin(a); /* X has been defined somewhere else */
fout3(N);
}
}
void fout3(int N)
{ ofstream ff("output_a1.out",ios::app);
ff << x[N] << '\t' << y[N] << '\t' << '\n';
}
|
**********************************************************************