0
$\begingroup$

I am computing a long Table[], but the computation of the last few elements is taking too long, and I am afraid I will never converge. I would like to access the part of the Table which has been already computed and then abort the evaluation. Is that possible and how? Thanks.

$\endgroup$
1

1 Answer 1

2
$\begingroup$

Perhaps you can adapt something like this

partial = Reap[CheckAbort[full=Table[Sow[expr]; expr, {i,1,1000}], Null]][[2,1]]
$\endgroup$
1
  • $\begingroup$ You could also use TimeConstrained instead of CheckAbort. $\endgroup$ Commented Mar 25, 2015 at 17:22

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