* Bug #13203 fixed - Fixed typo
[scilab.git] / scilab / modules / matio / help / en_US / savematfile.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3     * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4     * Copyright (C) 2004-2007 - INRIA - Serge STEER 
5     * Copyright (C) 2004-2007 - INRIA - Vincent COUVERT 
6     * 
7     * This file must be used under the terms of the CeCILL.
8     * This source file is licensed as described in the file COPYING, which
9     * you should have received as part of this distribution.  The terms
10     * are also available at    
11     * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
12     *
13     -->
14 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="savematfile">
15     <refnamediv>
16         <refname>savematfile</refname>
17         <refpurpose>write a Matlab MAT-file (binary or ASCII)</refpurpose>
18     </refnamediv>
19     <refsynopsisdiv>
20         <title>Calling Sequence</title>
21         <synopsis>savematfile('filename')
22             savematfile('filename', 'var1', 'var2', ...)
23             savematfile('filename', '-struct', 's')
24             savematfile('filename', '-struct', 's', 'f1', 'f2', ...)
25             savematfile(..., '-v4')
26             savematfile(..., '-v6')
27             savematfile(..., '-v7')
28             savematfile(..., '-v7.3')
29             savematfile filename var1 var2 ...
30         </synopsis>
31     </refsynopsisdiv>
32     <refsection>
33         <title>Arguments</title>
34         <variablelist>
35             <varlistentry>
36                 <term>filename</term>
37                 <listitem>
38                     <para>character string containing the path of the file (needed)</para>
39                 </listitem>
40             </varlistentry>
41             <varlistentry>
42                 <term>format</term>
43                 <listitem>
44                     <para>data format to use</para>
45                     <variablelist>
46                         <varlistentry>
47                             <term>"-mat"</term>
48                             <listitem>
49                                 <para>binary MAT-file (default)</para>
50                             </listitem>
51                         </varlistentry>
52                         <varlistentry>
53                             <term>"-ascii"</term>
54                             <listitem>
55                                 <para>8-bit ASCII format</para>
56                             </listitem>
57                         </varlistentry>
58                         <varlistentry>
59                             <term>"-ascii" "-double"</term>
60                             <listitem>
61                                 <para>16-bit ASCII format</para>
62                             </listitem>
63                         </varlistentry>
64                         <varlistentry>
65                             <term>"-ascii" "-tabs"</term>
66                             <listitem>
67                                 <para>delimits with tabs</para>
68                             </listitem>
69                         </varlistentry>
70                         <varlistentry>
71                             <term>"-ascii" "-double" "-tabs"</term>
72                             <listitem>
73                                 <para>16-digit ASCII format, tab delimited</para>
74                             </listitem>
75                         </varlistentry>
76                         <varlistentry>
77                             <term>"-v4"</term>
78                             <listitem>
79                                 <para>A format that MATLAB Version 4 can open</para>
80                             </listitem>
81                         </varlistentry>
82                         <varlistentry>
83                             <term>"-v6"</term>
84                             <listitem>
85                                 <para>A format that MATLAB Version 6 and earlier can open</para>
86                             </listitem>
87                         </varlistentry>
88                         <varlistentry>
89                             <term>"-v7"</term>
90                             <listitem>
91                                 <para>A format that MATLAB Version 7 and earlier can
92                                     open (default)
93                                 </para>
94                             </listitem>
95                         </varlistentry>
96                         <varlistentry>
97                             <term>"-v7.3"</term>
98                             <listitem>
99                                 <para>A format that MATLAB Version 7.3 and earlier can
100                                     open
101                                 </para>
102                             </listitem>
103                         </varlistentry>
104                     </variablelist>
105                 </listitem>
106             </varlistentry>
107             <varlistentry>
108                 <term>var1, var2</term>
109                 <listitem>
110                     <para>character strings containing the name of the variables to load (only for binary files)</para>
111                 </listitem>
112             </varlistentry>
113             <varlistentry>
114                 <term>"-struct" "s"</term>
115                 <listitem>
116                     <para>saves all fields of the scalar structure s as individual variables within the file filename.</para>
117                 </listitem>
118             </varlistentry>
119             <varlistentry>
120                 <term>"-struct" "s" "f1" "f2"</term>
121                 <listitem>
122                     <para>saves as individual variables only those structure fields specified (s.f1, s.f2, ...).</para>
123                 </listitem>
124             </varlistentry>
125         </variablelist>
126     </refsection>
127     <refsection>
128         <title>Description</title>
129         <para>
130             saves variables in a Matlab MAT-file from Scilab. The Scilab data types are
131             converted into the Matlab equivalents.
132         </para>
133     </refsection>
134     <refsection>
135         <title>Examples</title>
136         <programlisting role="example"><![CDATA[ 
137 A = rand(10,10);
138 B = sprand(100,100,0.1);
139 savematfile('test_matfile.mat','A','B','-v6');
140 clear;
141 loadmatfile('test_matfile.mat');
142 disp(A)
143 disp(B)
144  ]]></programlisting>
145     </refsection>
146     <refsection role="see also">
147         <title>See Also</title>
148         <simplelist type="inline">
149             <member>
150                 <link linkend="load">load</link>
151             </member>
152             <member>
153                 <link linkend="save">save</link>
154             </member>
155             <member>
156                 <link linkend="loadmatfile">loadmatfile</link>
157             </member>
158             <member>
159                 <link linkend="mfile2sci">mfile2sci</link>
160             </member>
161         </simplelist>
162     </refsection>
163     <refsection>
164         <title>Bibliography</title>
165         <para>This function has been developed following the "MAT-File Format"
166             description: 
167             <literal>
168                 <ulink url="http://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/matfile_format.pdf">Mat-File Format</ulink>
169             </literal>
170         </para>
171     </refsection>
172 </refentry>