Hello all,

I have been trying to learn Julia for I believe that it is a good 
alternative compared to the others that are in the "market"  nowadays. 
However, since Julia is a new language---and because there is not even one 
book out there to help the novice---, I start this thread here, although my 
question may be very basic.

So here it is: Assume that I write the following code and I want to save my 
results in a csv file.

# ------------------------------ CODE 
-----------------------------------------------------------

csvfile = open("y_save.csv","w")
write(csvfile,"y, \n")

# Set up the function
foo(i) = i^2

# Start the for loop

for i = 1:20
    y= foo(i)
    y_save = y
    write(csvfile, y_save,",", "\n")
end

#  ---------------------------- END 
------------------------------------------

The code that I wrote before is from this 
site: http://comments.gmane.org/gmane.comp.lang.julia.user/21070

Although I was able to make that work, I do not understand what I am doing 
wrong and the result I get in the csv is not readable.

I hope someone can provide some assistance with it.
Thanks in advance!

Reply via email to