Message Boards Message Boards

0
|
2812 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Create a table with results coming from "While" command

Posted 4 years ago

Hello,

I would like to store the results computed in a "while" loop in on unique Table with one unique TableHeadings. For now, I'm able to print the result at each stage and hence the Table Headings is reeted each time. I'm sure that there is a more suitable solution. Thank you!

My code:

While [R[t] >= 650 && t <= 300,
 .........
.......... 
 dataset = 
  TableForm[
   ptsF = Table[{t, R[t], W[t], G0[t], GC0[t], GLT[t], GP[t]}, {t, t, 
      t}], TableHeadings -> {None, {"t", "Ressources", "Extraction", 
      "Gain instantané", "Gain instantané cumulé", "Gain infini LT", 
      "Gain partie"}}]; Print[dataset];
 t++]
POSTED BY: marion davin
2 Replies
Posted 4 years ago

Hi Marion,

You could also use the TableWhile function from the Wolfram Function Repository.

POSTED BY: Rohit Namjoshi

Maybe you could use Sow[] to collect the un-formatted results inside the While and then use Reap[] to get the collected values.

POSTED BY: Gustavo Delfino
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract