how can i save a cell aray in matlab for ever?my project about finger vein identification

174 Views Asked by At

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

2

There are 2 best solutions below

0
On

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.

0
On

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.