* Bug #13203 fixed - Fixed typo
[scilab.git] / scilab / modules / matio / help / en_US / matfile_open.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) 2008 - INRIA - Vincent COUVERT 
5     * 
6     * This file must be used under the terms of the CeCILL.
7     * This source file is licensed as described in the file COPYING, which
8     * you should have received as part of this distribution.  The terms
9     * are also available at    
10     * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
11     *
12     -->
13 <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="matfile_open">
14     <refnamediv>
15         <refname>matfile_open</refname>
16         <refpurpose>Opens a Matlab binary MAT-file.</refpurpose>
17     </refnamediv>
18     <refsynopsisdiv>
19         <title>Calling Sequence</title>
20         <synopsis>fd = matfile_open(filename[, mode])</synopsis>
21     </refsynopsisdiv>
22     <refsection>
23         <title>Arguments</title>
24         <variablelist>
25             <varlistentry>
26                 <term>filename</term>
27                 <listitem>
28                     <para>String: the path of the file. Must contain only ANSI character.</para>
29                 </listitem>
30             </varlistentry>
31             <varlistentry>
32                 <term>mode</term>
33                 <listitem>
34                     <para>
35                         String: file access type (<literal>"r"</literal> by default).
36                     </para>
37                     <itemizedlist>
38                         <listitem>
39                             <para>
40                                 <emphasis>"r"</emphasis>: opens the file for reading.
41                             </para>
42                         </listitem>
43                         <listitem>
44                             <para>
45                                 <emphasis>"w"</emphasis>: opens the file for writing.
46                             </para>
47                         </listitem>
48                     </itemizedlist>
49                 </listitem>
50             </varlistentry>
51             <varlistentry>
52                 <term>fd</term>
53                 <listitem>
54                     <para>Real: file descriptor (-1 if opening failed).</para>
55                 </listitem>
56             </varlistentry>
57         </variablelist>
58     </refsection>
59     <refsection>
60         <title>Description</title>
61         <para>
62             Opens a Matlab binary MAT-file for reading or writing data.
63         </para>
64         <para>
65             <warning>
66                 If <varname>mode</varname> is set to <literal>w</literal>, the content of <varname>filename</varname> will be reseted.
67             </warning>
68         </para>
69     </refsection>
70     <refsection>
71         <title>Examples</title>
72         <programlisting role="example"><![CDATA[
73 A = rand(10,10);
74 B = sprand(100,100,0.1);
75 savematfile('test_matfile.mat','A','B','-v6');
76 clear();
77 fd = matfile_open("test_matfile.mat");
78 matfile_listvar(fd)
79 matfile_close(fd);
80
81 //fd = matfile_open("test_matfile.mat","w"); // Empty test_matfile.mat
82  ]]></programlisting>
83     </refsection>
84     <refsection role="see also">
85         <title>See Also</title>
86         <simplelist type="inline">
87             <member>
88                 <link linkend="matfile_close">matfile_close</link>
89             </member>
90             <member>
91                 <link linkend="matfile_varreadnext">matfile_varreadnext</link>
92             </member>
93             <member>
94                 <link linkend="matfile_varwrite">matfile_varwrite</link>
95             </member>
96             <member>
97                 <link linkend="matfile_listvar">matfile_listvar</link>
98             </member>
99         </simplelist>
100     </refsection>
101     <refsection>
102         <title>Bibliography</title>
103         <para>
104             This function uses MATIO library (
105             <literal>
106                 <ulink url="http://sourceforge.net/projects/matio/">http://sourceforge.net/projects/matio/</ulink>
107             </literal>
108             ).
109         </para>
110     </refsection>
111 </refentry>