The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: saving huge char arrays
Replies: 4   Last Post: Apr 17, 2013 3:07 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 15
Registered: 10/9/09
saving huge char arrays
Posted: Apr 17, 2013 2:35 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi all,

I have large char arrays (e.g. 3^17 by 17) which I need to save in plain text. Each array occupies about 2.5 Gb of disk space, and takes ~40 min (2646 seconds) to write line by line using fprintf:

for m=1:length(array)

Elapsed time is 2646.335813 seconds.

The file needs to be formatted as above to be interpreted by other apps.

Writing 2.5 Gb of data should not take that long. Is there a way to do the writing faster?

dumping the array as a single fprintf command strips the \r\n formatting (or should I manually encode the ASCII codes for "\", "n" for the single-line fprintf command?)

dlmwrite is even worse.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.