0

How can I save cell array in matlab when the program is over, that the programm running again use the same previous cell array?

marzie
  • 11
  • Is this a duplicate of http://math.stackexchange.com/questions/1901407/cell-aray-in-matlab… ? There are probably other StackExchange sites which are more suitable to ask this type of questions. – Watson Aug 23 '16 at 20:02
  • 1
    i have project and i need to save a cell aray of finger vein images for ever – marzie Aug 23 '16 at 20:24

2 Answers2

1

You can use the h5write command to save the cell array to a file in the HDF5 format. Then, load it via h5read.

See also the save command which outputs a Matlab binary file which can be loaded with load.

Batman
  • 19,390
1

Yes, you can use the command

save('filename')

which saves all of the variables in your workspace to a .m file in the directory of your program. If you only want a specific variable saved (call it X), then you can write

save('filename','X')

See http://se.mathworks.com/help/matlab/ref/save.html for documentation.

You can retrieve the variables when you later open up your script again by using

load('filename')

See http://se.mathworks.com/help/matlab/ref/load.html for documentation.

In the future, please ask such questions in Stack Overflow instead.