TA_Kosice
TA_Kosice

Reputation: 13

NetLogo: matrix output to CSV

I would like to have matrix in CSV file as you can see below:

 - element11;element12;element13;element14
 - element21;element22;element23;element24
 - element31;element32;element33;element34

and so on.

I do not know how to force NetLogo to stop to write into rows of the first column and to go to the second, third and further columns.

Is there another possibility how to do output of matrix?

Upvotes: 1

Views: 558

Answers (1)

Charles
Charles

Reputation: 4168

I haven't tested this, but something like the following should work.

let matlist matrix:to-row-list my-matrix
foreach matlist [
  foreach but-last ? [
    file-type ?
    file-type ","
    ]
  file-type last ?
  file-type "\n"
]

Upvotes: 1

Related Questions