Add sample SOD and ZCOS icons files
[scilab.git] / scilab / modules / fileio / help / en_US / fprintfMat.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
5  * Copyright (C) 2010 - DIGITEO - Allan CORNET
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-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:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="fprintfMat" xml:lang="en">
15     <refnamediv>
16         <refname>fprintfMat</refname>
17         <refpurpose>writes a matrix in a file</refpurpose>
18     </refnamediv>
19     <refsynopsisdiv>
20         <title>Calling Sequence</title>
21         <synopsis>fprintfMat(file,M [,format,text])</synopsis>
22     </refsynopsisdiv>
23     <refsection>
24         <title>Arguments</title>
25         <variablelist>
26             <varlistentry>
27                 <term>file</term>
28                 <listitem>
29                     <para>a string, the pathname of the file to be written</para>
30                 </listitem>
31             </varlistentry>
32             <varlistentry>
33                 <term>M</term>
34                 <listitem>
35                     <para>a matrix of real numbers</para>
36                 </listitem>
37             </varlistentry>
38             <varlistentry>
39                 <term>format</term>
40                 <listitem>
41                     <para>a character string giving the format. This is an optional
42                         parameter, the default value is <literal>"%lf"</literal>.
43                     </para>
44                     <para>Supported format:
45                         <literal>%[width].[precision]type</literal> or
46                         <literal>%type</literal>, where:
47                     </para>
48                     <para>
49                         <literal>width</literal>: an optional number that specifies the minimum number of characters output;
50                     </para>
51                     <para>
52                         <literal>precision</literal>: an optional number that
53                         specifies the maximum number of characters printed for all
54                         or part of the output field, or the minimum number of
55                         digits printed for integer values; 
56                     </para>
57                     <para>
58                         <literal>type</literal>: lf, lg, d, i, e, f, g (see <link
59             linkend="scanf_conversion">scanf_conversion</link> for details).
60                     </para>
61                 </listitem>
62             </varlistentry>
63             <varlistentry>
64                 <term>text</term>
65                 <listitem>
66                     <para>
67                         a row (column) vector of strings giving non numerical
68                         comments stored at the beginning of the file. 
69                     </para>
70                 </listitem>
71             </varlistentry>
72         </variablelist>
73     </refsection>
74     <refsection>
75         <title>Description</title>
76         <para>
77             The <literal>fprintfMat</literal> function writes a matrix in a
78             formated file. Each row of the matrix give a line in the file. If
79             <literal>text</literal> is given then the elements of
80             <literal>text</literal> are inserted elementwise at the beginning of the
81             file one element per line.
82         </para>
83     </refsection>
84     <refsection>
85         <title>Examples</title>
86         <programlisting role="example"><![CDATA[ 
87 n = 50;
88 a = rand(n, n, "u");
89 fprintfMat(TMPDIR + "/Mat", a, "%5.2f");
90 a1 = fscanfMat(TMPDIR + "/Mat");
91
92 // Lets we create a file Mat1 and insert a comment into it
93 some_comment = ["This is a comment","This the second line of the comment.","This is the third line of the comment."];
94 fprintfMat(TMPDIR + "/Mat1", a, "%5.2f",some_comment);
95    ]]> </programlisting>
96     </refsection>
97     <refsection role="see also">
98         <title>See Also</title>
99         <simplelist type="inline">
100             <member>
101                 <link linkend="scanf_conversion">scanf_conversion</link>
102             </member>
103             <member>
104                 <link linkend="mclose">mclose</link>
105             </member>
106             <member>
107                 <link linkend="meof">meof</link>
108             </member>
109             <member>
110                 <link linkend="mfprintf">mfprintf</link>
111             </member>
112             <member>
113                 <link linkend="mfscanf">mfscanf</link>
114             </member>
115             <member>
116                 <link linkend="fscanfMat">fscanfMat</link>
117             </member>
118             <member>
119                 <link linkend="mget">mget</link>
120             </member>
121             <member>
122                 <link linkend="mgetstr">mgetstr</link>
123             </member>
124             <member>
125                 <link linkend="mopen">mopen</link>
126             </member>
127             <member>
128                 <link linkend="mprintf">mprintf</link>
129             </member>
130             <member>
131                 <link linkend="mput">mput</link>
132             </member>
133             <member>
134                 <link linkend="mputstr">mputstr</link>
135             </member>
136             <member>
137                 <link linkend="mscanf">mscanf</link>
138             </member>
139             <member>
140                 <link linkend="mseek">mseek</link>
141             </member>
142             <member>
143                 <link linkend="mtell">mtell</link>
144             </member>
145             <member>
146                 <link linkend="mdelete">mdelete</link>
147             </member>
148         </simplelist>
149     </refsection>
150 </refentry>