Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

Simple way to save several variables

$
0
0

Although I have been using Julia for over a year now, I still have problems with basic things, so I consider myself to be a ‘newbie’, so please be gentle.

I would like a simple way for me (and my students) to be able to save a few variables to the same file, and read them in again.

There have been many suggestions on here, and this seems to evolve all the time, but I can’t seem to find a simple answer.

Suppose there are arrays A1 and A2

I would like something like

write(filename, A1, A2)

read(filename)

Or even to be able to read and write a dictionary of variables

dict1=Dict(“A1”=>A1,“A2”=>A2)

write(filename,dict1)

dict2=read(filename)

I find it surprising that after all the time and work which has been devoted
to the Julia project, there is no clear and simple solution to this (or at least
one I could find).
PS. MAT seemed to do what I wanted, but the files are huge (even with compression) and anyway, it doesn’t seem to be supported any more (or at least it doesn’t work for me).

Thanks for any help.

11 posts - 5 participants

Read full topic


Viewing all articles
Browse latest Browse all 2795

Latest Images

Trending Articles



Latest Images