Skip to content

Instantly share code, notes, and snippets.

@mschauer
Created September 12, 2018 10:19
Show Gist options
  • Select an option

  • Save mschauer/5e788918feca72713091387421eecb9b to your computer and use it in GitHub Desktop.

Select an option

Save mschauer/5e788918feca72713091387421eecb9b to your computer and use it in GitHub Desktop.
Q: How do you write a (large) matrix to a file like it prints in the REPL, but without the `...`?
#Q: How do you write a (large) matrix to a file like it prints in the REPL, but without the `...`?
#A: @pfitzseb
x = rand(100,100)
open(expanduser("~/test"), "w") do io
ctx = IOContext(io, :size => (100000,100000))
show(ctx, "text/plain", x)
end
@pfitzseb

Copy link
Copy Markdown

IOContext(io, :size => (100000,100000)) should actually just be IOContext(io, :limit => false).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment