Page 1 of 1

How to avoid line breaks when writing a matrix to a file?

Posted: Fri Feb 22, 2013 6:47 am
by jonasdovern
When using the following code to write a large matrix to a text file, I have the problem that RATS makes several line breaks for each row of the matrix. (Similar to what RATS also does when displaying a large array in the output file on the screen.)

Code: Select all

decl rec G
comp G = %zeros(200,200)
open copy Gmat.txt
    display(unit=copy) G
close copy
Is there any way to avoid these line breaks?

Re: How to avoid line breaks when writing a matrix to a file

Posted: Fri Feb 22, 2013 3:14 pm
by TomDoan
Try

write(unit=copy,format=prn) g

Use a PICTURE clause if you want it to line up better.

DISPLAY is really designed to put output to the screen, so 2000 character lines aren't permitted.