Linked Questions

6
votes
3answers
4k views

Save and call matrices with large output in Mathematica [duplicate]

If we have the large matrix A=RandomReal[{-10, 10}, {1000, 1000}]; and I need it for further calculation, how can I save it on hard disk and then call for ...
2
votes
1answer
3k views

How to export/import function values [duplicate]

I have a function with two variables: f[x_,y_]:=f[x,y] = ... I calculated some values (they are fractions like 435345345/3424242424) and would like to store the ...
4
votes
1answer
3k views

Can an Interpolation function be 'saved'? [duplicate]

Possible Duplicate: Save interpolated function I am importing tables with sizes of 100k - 500k rows and 4 columns. The larger the table, the slower my Mathematica runs for all computations after ...
2
votes
2answers
232 views

How to store an InterpolatingFunction? [duplicate]

Assume I have obtained an InterpolatingFunction, say, as the result of solving of a differential equation, say, this one: ...
2
votes
3answers
279 views

How to store the nonzero elements of a sparse array in a file? [duplicate]

Often I need to use same matrix several times and for that I save them in an external file. Converting the matrix into SparseArray can save a lot of space in this ...
1
vote
1answer
716 views

How to store a SparseArray? [duplicate]

How to Export/Write a SparseArray? How to Import/Read a SparseArray? Is it always stored as a normal array? How can it be stored in a dense form? Is a numerical SparseArray different to Export/Import ...
2
votes
1answer
752 views

Export mathematical expressions for further reuse [duplicate]

I am dealing with a program with Mathematica where I compute expressions that take a very long time to compute. I need these results for further computation and/or display. I would like not to have to ...
2
votes
2answers
397 views

Exporting arrays for storage [duplicate]

I have a set of arrays I would like to output to some file ArrayStorage.txt s.t. these arrays could be read-in to a separate notebook on a separate kernel. Is ...
0
votes
0answers
292 views

Assign variable's value programmatically [duplicate]

Not easy to explain what I'm looking for, so please sorry if I'm not so short. Having many variables to be managed in several different combinations, I need to automate the assignment of preset ...
2
votes
1answer
104 views

How to use external Mathematica Code? [duplicate]

I have a Mathematica Notebook with a function that i would like to be able to access from another Notebook without having to have the first Notebook open. The functions calls other functions in the ...
1
vote
0answers
208 views

Transferring a list from one notebook to another [duplicate]

I have Mathematica code split into two notebooks. The first part is supposed to run and output a list of numbers into a text file, using Export. The second part ...
0
votes
1answer
148 views

How to save a list of analytic expressions in a file? [duplicate]

I use Mathematica to calculate many analytic expressions, some of them are generated by a loop process, the result can be a vector with a index, e.g., f[i]. Now ...
3
votes
0answers
64 views

How can I append Mathematica variables to an output file preserving both names and values? [duplicate]

I have a Mathematica program that calculates a series of large vectors that I need to save for future reference (in addition to some scalar values). I want to save all these to a file, tagged by their ...
0
votes
0answers
51 views

DumpSave a variable in Do loop [duplicate]

I have the following code: ...
0
votes
0answers
51 views

Using data of a compiled code in future [duplicate]

I have run a huge amount of code to find a 9 by 9 matrix called A. I want to use elements of this matrix in future when I open the Mathematica again. Is it possible? How can I do that? An step by step ...
1
vote
0answers
47 views

What is a good way to import interpolating functions of large size? [duplicate]

I was generating a set of eigenfunctions from a differential equation using NDEigensystem. Because of the computer time cost is too high, I thought it'd be better ...
0
votes
0answers
46 views

Exporting large expression [duplicate]

I generated a huge mathematical expression (~200k terms, impossible to simplify yet) and want to save it for later analysis. Last time I did Export to *.nb file and ...
184
votes
2answers
10k views

What is the distinction between DownValues, UpValues, SubValues, and OwnValues?

When reading through the documentation, you often encounter the phrases DownValues, UpValues, ...
68
votes
7answers
4k views

Functions vs. patterns

Every time I define a new function, I wonder which construct I should use: true functions obtained by using Function, or rule-based syntax. For example, these are ...
60
votes
7answers
15k views

Saving data inside a notebook so that I don't have to run it again?

Piggybacking on this, I am somehow not fully convinced that I can't save data generated by a calculation in a mathematica file so that when I re-launch said file, I wouldn't have to run my ...
116
votes
1answer
7k views

File-backed lists/variables for handling large data

Background Currently I am working with some large data (most of it generated by Mathematica itself). I usually find it a hassle to do this. For example, I just exported a large amount of data to ...
34
votes
2answers
8k views

How to save all data in all variables so that loading it is fast?

I've got this CSV file I've imported that has tens of millions of lines in it. It takes around 20 minutes to import. I've been working with it for a while and have the processed data spread out in a ...
29
votes
3answers
2k views

DumpSave for the forgetful

A few weeks ago I created a big matrix, and in order not to have to recreate it, I stored it using DumpSave["file.mx", variable]. Now I want to read it back in and ...
49
votes
3answers
3k views

How to distribute proprietary Mathematica code

If I want to make package-code completely unreadable, in a way that the end-user can only call my functions, but has no way to re-engineer my definitions, how would I do that? I know I can use ...
34
votes
2answers
2k views

When to use Get vs Needs

When should I use << vs Needs? I just always use Needs as ...
15
votes
4answers
8k views

How do I save/export a list so that it can later be easily imported as a list again?

I have a couple of big lists (each of them contains elements that are themselves lists of two elements, i.e. an element of each list that I have is of the form {x, y}) that I want to save/export. ...
10
votes
3answers
582 views

Find variable name from DumpSave on a scoped variable

I saved an InterpolationFunction in a ".mx" files using DumpSave on a variable that was scoped by a ...
8
votes
1answer
6k views

How can I save and recall my own function?

In MATLAB, I can save and recall my own function using an M-File(function or script) How can I do something similar in Mathematica? I already searched and know how to define functions and modules ...
12
votes
3answers
693 views

Exporting and reimporting a list of lists changes the dimensions

Could anyone explain to me what in the world is going on here and please help me in reading in dummy.dat properly? ...
4
votes
2answers
2k views

Save variables values and definition

I used to do a lot of programming in R and recently switched to Mathematica. One thing that bothers me is that I haven't found a way to save variables, their values and definition! Let's look at an ...
9
votes
1answer
1k views

How to properly DumpSave & Get Global`s symbols inside packages while not touching Global context?

For efficiency reasons I prefer to use DumpSave instead of Save. For ease of access I prefer to save symbols in ...
3
votes
2answers
2k views

How to export a table of complex numbers?

I'm having problems exporting a table of complex numbers. I have: ...
5
votes
3answers
331 views

Save associations to a file and reload

I have many (say 2 for now) associations that I want to save to a file ...
8
votes
1answer
178 views

Most efficient method for export/import of non-traditional tensor-style dimensions of matrices/tables/lists-of-lists-of-lists(-of lists)?

Hello World! (I did it for my first answer, so it only feels proper...I'm not nostalgic, you are!) OKAY, here we go! Let's start off with the good-stuff, here's my code, made relatively arbitrary, ...
3
votes
1answer
268 views

How can I export definitions of several symbols to a single file?

the problem related to this question What I want to do is to Export definition of several symbol into a single file. The reason I choose ...
3
votes
2answers
432 views

Problems with DumpSave and memoization

I defined a function that takes some time to compute using memoization: y[a_, b_, c_] := y[a, b, c] = First[$y /. NDSolve[.........] so that if I call y[a,b,c] ...
4
votes
1answer
333 views

Hiding body of a module or function in mathematica

Is it possible to hide the body of a module or function in MMA? For example I would like to turn this: myModule[]:=[{}, Body of module ] to: ...
2
votes
1answer
289 views

Backward compatibility issues while DumpSaving Interpolation polynomials

I have bkwrd compatibility issues when I save my NDSolve result (which is an interpolating polynomia) using DumpSave from Mathematica 8 on Windows 7 and then try ...
0
votes
1answer
563 views

Export array data into a file

I tried to solve some equation for different values of parameter t and put results into array. Then I wanted to write this data into a txt-file. So i did it with ...
2
votes
1answer
373 views

Transfer of symbols between contexts

As many others (I guess) I'm struggling with the handling of contexts within Mathematica. I'm working on a new package definition with the usual syntaxt specified by the Mathematica documentation: <...
4
votes
0answers
372 views

How to save (large) data generated from simulations

The following is a simple example of a much larger simulation that I want to run Define some processes ...
4
votes
1answer
170 views

Saving and loading lists of interpolating functions fast and cross-platform

Is there any way to save and load several lists of interpolating functions efficiently and cross-platform? I want to save the resulting interpolating functions of NDSolve which takes very long to ...
1
vote
1answer
224 views

Mathematica: issues storing nested list on disk

having trouble with mathematica using nested lists. I want to save a list like this: l1={{a1,{a,b,c,d,e}},{a2,{f,g,h,i}}} So, the nested components do not have ...
1
vote
1answer
185 views

Saving/exporting results from FindInstance and similar functions

I am dealing with a problem that requires the use of both FindInstance and FindRoot nested in a non-trivial way. The result is dependent on some parameter value $t \in [0,1)$, therefore I use ...
1
vote
1answer
152 views

Persistent memoized functions [duplicate]

I'm inspired to make use of "remembering the function values" technique from here: Functions that remember their values The only question is: how can I save the function, along with its values stored ...
1
vote
1answer
116 views

Is there a way to generate graphs without vizualization for simulation purposes?

I'm doing a lot of simulation runs of graphs in order to compare the simulated data with the data of a real world network (links among websites), according to my calculations I have to run close to a ...
4
votes
0answers
103 views

Determining what symbols are defined in a DumpSave / .mx file [duplicate]

Against my better judgement, and in the interest of speedy I/O, I've decided to use .mx files for a project - limitations and all. I'm dealing with a few gigabyte-...
3
votes
0answers
102 views

Simply save a polynomial to a text file, with a symbol change I->%i and w/o NumberMarks

I must be really missing something here because I've tried many things on this link: How do I save a variable or function definition to a file? but still wind up with something I don't want. I have ...
1
vote
0answers
55 views

Can I store output data in the Notebook file? Specifically output from NDSolve[ ]

I am having some outputs from NDSolve of the form {{x→InterpolatingFunction[…], y→InterpolatingFunction, … }} and the ...