Writing variables to a file, MATLAB in Mathematics

Writing variables to a File:

The save command is used to write variables to a file, or to append the variables to a MAT-file. By the default, save function writes to a MAT-file. It can either save the whole present workspace (all variables which have been generated), or a subset of the workspace (involving, for illustration, just 1 variable). The function save will save the file in the present directory, therefore it is important to set that properly first.

To save all the workspace variables in a file, the command is as shown below:

save filename

The .mat extension is automatically added to the filename. The contents of the file can be exhibited by using who with the -file qualifier:

who -file filename

 

 

Posted Date: 10/20/2012 6:40:55 AM | Location : United States







Related Discussions:- Writing variables to a file, Assignment Help, Ask Question on Writing variables to a file, Get Answer, Expert's Help, Writing variables to a file Discussions

Write discussion on Writing variables to a file
Your posts are moderated
Related Questions
Using Functions with the Vectors and Matrices: As MATLAB is written to work with the vectors and matrices, the whole vector or matrix can be passed as an argument to the funct


Logical Vectors: The relational operators can also be used with the vectors and matrices. For illustration, let's say that there is a vector, and we want to compare each eleme

Built-in function for Differentiation: The MATLAB has a built-in function, diff that returns the differences between consecutive elements in a vector. For illustration, >>

Illustration of Advanced file input and output: For illustration, to refer to the third number in the first element of the cell array: >> subjdata{1}(3) ans =

Three-Dimensional Plots: The MATLAB has many functions which will display three-dimensional plots. Most of these functions have similar name as corresponding two-dimensional p

Illustration of Writing variables to a file: For illustration, in the below session in the Command Window, 3 variables are generated; these are then exhibited using who. Then,

Symbolic Expression The solve function solves an equation and returns the solution(s) as symbolic expressions. The answer can be converted to numbers by using any numeric funct

Writing and Reading Spreadsheet Files: The MATLAB functions xlswrite & xlsread will write to and read from the spreadsheet files which have the extension .xls. For illustratio

Structure Consisting of the Fields A MATLAB can also solve the sets of equations. In this illustration, the solutions for x, y, & z are returned as a structure consisting of th