Save
Usage
• Save["filename", symbol] 把与指定符号相关的定义添加到一个文件中.
• Save["filename", "form"] 把与名称与字符串模式form相匹配的所有符号相关的定义添加到一个文件中.
• Save["filename", "context`"] 把与指定上下文中的所有符号相关的定义添加到一个文件中.
• Save["filename",  , , ... ] 把与几个对象相关的定义添加到一个文件中.
Notes
• Save 使用 FullDefinition 来包含辅助定义. •Save 在 InputForm 中写出定义. •Save 使用 Names 来查找名称与给定字符串模式匹配的符号. • 可以使用Save["filename", "s"]来写出符号s的值的定义.
Further Examples
Here is a definition for a function f and an assignment for the parameter c. We then save the definition of f in the file tempf and clear the two definitions.
In[1]:=
|
Out[1]=
|
In[2]:=
|
Out[2]=
|
In[3]:=
|
The file contains both the definition of f and the definition of c on which f depends. You can reinstate the definitions you saved by reading back the file tempf with Get (short form <<).
In[4]:=
|
|