I have simple code which goes like this:
ClearAll["Global`*"]
et = 1 + 34/(k^2 3);
pt = (2 (1 + (\[Omega] 3)/(Sqrt[2] k)))/k^2 + (
1 + 2/(\[Omega] Sqrt[2] k))/k^2 + (1 + \[Omega]^2/(Sqrt[2] k))/k^2;
equation = NSolve[et + pt == 0, \[Omega]];
dattta = Table[equation, {k, 0, 2}]
Export["nice.dat", dattta]
I have some questions in this regard.
1) How can I format the output? As you cn see from the o/p dat file that all are kind of mixed. What if I want real part in the first column, then imaginary part in the next column?
2) How can I put heading in the output file? For example, I want to write at top of first column "k" and at top of second column I want to write "$\omega$"?
3) If you take example of any other programming language like for eg. MATLAB, the output file by default goes into the folder where the parent program is (if you want to change the path then you have to give the path of the folder). But that is not the case with Mathematica. Is there to get around of this issue?
Thanks in advance...
SetDirectory[NotebookDirectory[]]
which sets the current working directory to wherever your parent notebook file is located. $\endgroup$NotebookDirectory[]
is the way to go but if you want to discuss further you should say what system. $\endgroup$