saveSave a variable or a serie of variables in a binary
file
Calling Sequencesave(filename [,x1,x2,...,xn])
save(fd [,x1,x2,...,xn])
ArgumentsfilenameCharacter string containing the path of the filefdA file descriptor given by a call to mopenxiArbitrary Scilab variable(s)Description
The save command can be used to save Scilab
current variables in a binary file. If a variable is a graphic handle, the
save function saves all the corresponding graphics_entities definition.
The file can be given either by its paths or by its descriptor
previously given by mopen.
save(filename) saves all current variables in the
file defined by filename.
save(fd) saves all current variables in the file
defined by the descriptor fd. This prototype is obsolete and will be removed in Scilab 6.save(filename,x,y) or save(fd,x,y) (with x and y variables of your environment) saves only named variables x and y. save(fd,x,y) is obsolete and will be removed in Scilab 6.save(filename,"x","y") (with "x" and "y" names of variables of your environment) will save your data using the SOD (Scilab Open Data) format (based on HDF5), format that will be readable by Scilab 6 family.
save(filename,"-append","w", "z") (with "w" and "z" names of variables of your environment) will append your data in the existing SOD file called filename.
The change of format between the family 5 and 6 of Scilab has been decided because the 5 format is undocumented, not specified and hard to read. SOD (Scilab 6 default format) is fully documented and easy to read through HDF5 libraries or applications.
Saved variables can be reloaded by the
load
command.
Note that the written file is portable to other operating systems and architectures (little and big endian).
ExamplesSee Also
load
write
save_format
mopen
History5.0.0
All uimenu or uicontrol handles are also saved by this function.
5.4.0When called with variables names (character string) as input, variables are saved in SOD format, format that will be readable by Scilab 6 family.The Scilab 5.X format is deprecated and will be removed with Scilab 6.Using save with a file descriptor as first input argument is deprecated and will be removed with Scilab 6.