Im trying to export data from the interpolating function result to excel.
everything works fine and the plots are as expected, but if I want to export these data to excel using
Export["data.xlsx", Table[Flatten[{t, soldata}], {t, 0, tmax}]]
the t values only show 1 decimal whereas the soldata results are expressed in much as 15 decimals. This makes the exported file missing many cells. How can I make t in the excel file export as much decimals.
Here is the last part of the code
sol = ParametricNDSolveValue[{eqns, init}, vars, {t, 0, 2}, {p}]
soldata = Evaluate[sol[100][[1]], sol[100][[2]]]
excelData = Table[Flatten[{t, soldata}], {t, 0, 2}]
Export["data.xlsx", excelData]
soldata
. Is it a list? Is it a 2-dimensional array where each row is a list of values? Ifsoldata
is a 2D array, is there a row for each of0
totmax
? $\endgroup$excelData = Table[Flatten[{t, soldata}], {t, 0, 2, 0.001}
$\endgroup$soldata
, but from your edit, I assumesoldata
is a 2D array with 2 columns, and rows fort = 0
, tot = tmax
. Do you want column 1 of the Excel data to be values equally spaced between0
andtmax
? I’ll assume... I’ve replaced my answer. $\endgroup${t, 0, 2, 0.001}
did the job. I don't know why when I tried this before, It did not work. Its a very simple solution but I missed it. My bad. Thanks everyone $\endgroup$