help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fast generation of text file


From: wild.manul
Subject: Fast generation of text file
Date: Wed, 1 Jun 2011 01:11:36 -0700 (PDT)

Hello

I need to write task for linear programming solver in text file from Octave.
The structure of text file is following:

a11 x1+ a12 x2+ a13 x3+ ... +a1n xn
....
an1 x1+ an2 x2+ an3 x3+ ... +ann xn

where a11, ..., ann are given coefficients. x1,...,xn are symbols x with
indexes. Coefficients and indexes are stored in matrix a:
a11 1 a12 2 a13 3 ... a1n n
....
an1 1 an2 2 an3 3 ... ann n
Problem is that matrix is rather huge - 2000x2000 elements and writing it to
text file is slow. 

I wrote the following code to do that:

for i:row do
 fprintf(fid,'%7.5f x%d+',a(i,:)); 
end

May be there is faster way how to do it?

--
View this message in context: 
http://octave.1599824.n4.nabble.com/Fast-generation-of-text-file-tp3565211p3565211.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]