Select Your Country
4 stars based on
Rational ApproximationsPrevious: Terminal InputUp: Basic Input and Output Save the named variables v1v2If no variable names are listed, Octave saves all the variables in the current scope.
Valid options for the save command are listed in the following table. If save is invoked using the functional form save "-text", "file.
You should use this format only if you know that all the values to be saved can be represented in single precision. This works equally on files that are compressed with gzip outside of octave, and gzip can equally be used to convert the files for backward compatibility.
The list of variables to save may include wildcard patterns containing the following special characters: Match any single character.
If the first character is! Load the named variables from the file file. As with saveyou may specify a list of variables and load will only extract those variables with names that match. For example, to restore the variables saved in the file datause the command load data If load is invoked using the functional form load "-text", "file.
If a variable that is not marked as global is loaded from a file when a global symbol with the same name already exists, it is loaded in the global symbol table. Also, if a variable is marked as global in a file and a local symbol exists, the local symbol is moved to the global symbol table and given the value from the file.
Since it seems that both of these cases are likely to be the result of some sort of error, they will generate warnings. If invoked with a single output argument, Octave returns data instead of inserting variables in the symbol table.
If the data file contains only numbers TAB- or space-delimited columnsa matrix of values is returned. Otherwise, load returns a structure with members corresponding to the names of the variables in the file. The load command can read data stored in Octave's text and binary formats, and Matlab 's binary format. It will automatically detect the type of file and do conversion from different floating point formats currently only IEEE big and write binary string to file matlab endian, though other formats may added in the future.
Valid options for load are listed in the following table. Octave now overwrites variables currently in write binary string to file matlab with the same name as those found in the file. Data in the file will be loaded as a single numeric matrix with the name of the variable derived from the name of the file. Note that Octave can read HDF5 files not created by itself, but write binary string to file matlab skip some datasets in formats that it cannot support.
Octave can now support multi-dimensional HDF data and automatically modifies variable names if they are invalid Octave identifiers. There are three functions that modify the behavior of save. Typical values include "-ascii""-ascii -zip". The default value is -ascii. It is possible to write data to a file in a way much similar to the disp function for writing data to the screen.
The write binary string to file matlab works just like disp except its first argument is a file pointer as created by fopen. For example, fdisp stdout, "The value of pi is: Basic Input and Output.