I used the following code

pUlimit = 5; pStep = 1; pStart = 1;
qUlimit = .005; qStep = .0005; qStart = .001;
p = Table[i, {i, pStart, pUlimit, pStep}];
q = Table[j, {j, qStart, qUlimit, qStep}];
dimp = Dimensions[p][[1]];
dimq = Dimensions[q][[1]];

Output in 'data3.dat' looks like

enter image description here

But when I use following code

data3 = Table[{p[[i]], q[[j]]}, {i, 1, dimp},{j,1,dimq}]
Export["data3.dat", data3];

Output in 'data3.dat' looks like this

enter image description here

But I want output like this in data3 file.,

enter image description here



data3 = Flatten[Table[{p[[i]], q[[j]]}, {i, 1, dimp}, {j, 1, dimq}], 1]
Export["data3.dat", data3, "Table"];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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