Dani
Dani

Reputation: 63

How to load a matlab MAT file from memory?

Let's say I have an array of the bytes of a mat file loaded into my Matlab shell. One way to parse this data is to write it to the disk, and then use Matlab load function. Is there a way to do that without writing to the hard drive (on windows)?

I know that in unix I might be able to write the data to a named pipe and load from it, but I don't think this would work in windows.

The only solution I could think of is using a Ram Disk. Will be glad to hear other ideas.

Upvotes: 1

Views: 949

Answers (1)

sage
sage

Reputation: 5514

I would probably go to the clipboard. At least in R2011b, you can both import from and save data to the clipboard:

doc clipboard tells about writing to (and reading from) the clipboard

doc importdata gives the following snippet:

[...] = importdata('-pastespecial', ...) loads data from the system clipboard rather than from a file

Upvotes: 2

Related Questions