[julia-users] Re: How to write a binary data file? (Matlab to Julia translation)

2016-09-21 Thread Steven G. Johnson
On Wednesday, September 21, 2016 at 5:23:24 AM UTC-4, Dennis Eckmeier wrote: > > thanks for the help! Coming from Matlab data types and binary files had > never been a concern... > You had to explicitly pass 'integer*4' in Matlab, so they were a concern there too, it is just that you express

[julia-users] Re: How to write a binary data file? (Matlab to Julia translation)

2016-09-21 Thread Dennis Eckmeier
Hi, thanks for the help! Coming from Matlab data types and binary files had never been a concern... it was about time I learned how to do this! I was able to complete the Julia wrapper for Barnes Huts t-sne, and I will put it on github :) Next up: plotting the results ;) cheers, Dennis On W

[julia-users] Re: How to write a binary data file? (Matlab to Julia translation)

2016-09-20 Thread Steven G. Johnson
On Tuesday, September 20, 2016 at 3:46:47 PM UTC-4, Dennis Eckmeier wrote: > > So, I tried this, but the data are still not stored as the Matlab code > (first post) would do it... > > function write_data(X, no_dims, theta, perplexity) > n, d = size(X) > A = write(h, hton(n), hton(d), hton(th

[julia-users] Re: How to write a binary data file? (Matlab to Julia translation)

2016-09-20 Thread Steven G. Johnson
On Tuesday, September 20, 2016 at 3:46:47 PM UTC-4, Dennis Eckmeier wrote: > > So, I tried this, but the data are still not stored as the Matlab code > (first post) would do it... > > function write_data(X, no_dims, theta, perplexity) > n, d = size(X) > h = open("data.dat","w+") > w+ means

[julia-users] Re: How to write a binary data file? (Matlab to Julia translation)

2016-09-20 Thread Dennis Eckmeier
So, I tried this, but the data are still not stored as the Matlab code (first post) would do it... function write_data(X, no_dims, theta, perplexity) n, d = size(X) h = open("data.dat","w+") A = write(h, hton(n), hton(d), hton(theta), hton(perplexity), hton(no_dims)) # X=X' for i in ea

[julia-users] Re: How to write a binary data file? (Matlab to Julia translation)

2016-09-11 Thread Steven G. Johnson
On Sunday, September 11, 2016 at 3:10:22 PM UTC-4, Dennis Eckmeier wrote: > > Update: Currently trying hton() to write in big endian, but apparently it > doesn't have a method for arrays? > Just call hton in a loop. In Julia 0.5, you could call hton.(a) on an array, but this kind of usage is p

[julia-users] Re: How to write a binary data file? (Matlab to Julia translation)

2016-09-11 Thread Dennis Eckmeier
Update: Currently trying hton() to write in big endian, but apparently it doesn't have a method for arrays?

[julia-users] Re: How to write a binary data file? (Matlab to Julia translation)

2016-09-11 Thread Dennis Eckmeier
* sorry, I forgot to mention: in the Matlab code the file is opened and closed with 'big-endian ordering'.