~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to man/eng/fileio/mprintf.xml

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
 
2
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
 
3
<MAN>
 
4
  <LANGUAGE>eng</LANGUAGE>
 
5
  <TITLE>mprintf</TITLE>
 
6
  <TYPE>Scilab Function</TYPE>
 
7
  <DATE>Aug 1999</DATE>
 
8
  <SHORT_DESCRIPTION name="mfprintf"> converts, formats, and writes  data to a file</SHORT_DESCRIPTION>
 
9
  <SHORT_DESCRIPTION name="mprintf"> converts, formats, and writes  data to the main scilab window</SHORT_DESCRIPTION>
 
10
  <SHORT_DESCRIPTION name="msprintf"> converts, formats, and writes  data in a string</SHORT_DESCRIPTION>
 
11
  <CALLING_SEQUENCE>
 
12
    <CALLING_SEQUENCE_ITEM>mfprintf(fd,format,a1,...,an);  </CALLING_SEQUENCE_ITEM>
 
13
    <CALLING_SEQUENCE_ITEM>mprintf(format,a1,...,an);  </CALLING_SEQUENCE_ITEM>
 
14
    <CALLING_SEQUENCE_ITEM>str=msprintf(format,a1,...,an);  </CALLING_SEQUENCE_ITEM>
 
15
  </CALLING_SEQUENCE>
 
16
  <PARAM>
 
17
    <PARAM_INDENT>
 
18
      <PARAM_ITEM>
 
19
        <PARAM_NAME>fd</PARAM_NAME>
 
20
        <PARAM_DESCRIPTION>
 
21
          <SP>: scalar, file descriptor given by <VERB>mopen</VERB> (it's a positive integer). The value <VERB>-1</VERB> refers to the default file ( i.e the last opened file).</SP>
 
22
        </PARAM_DESCRIPTION>
 
23
      </PARAM_ITEM>
 
24
      <PARAM_ITEM>
 
25
        <PARAM_NAME>format</PARAM_NAME>
 
26
        <PARAM_DESCRIPTION>
 
27
          <SP>: a Scilab string describing  the format to use to write  the  remaining  operands.  The format operand follows, as close as possible,  the C printf format operand syntax.</SP>
 
28
        </PARAM_DESCRIPTION>
 
29
      </PARAM_ITEM>
 
30
      <PARAM_ITEM>
 
31
        <PARAM_NAME>str</PARAM_NAME>
 
32
        <PARAM_DESCRIPTION>
 
33
          <SP>: a character string, string to be scanned.</SP>
 
34
        </PARAM_DESCRIPTION>
 
35
      </PARAM_ITEM>
 
36
      <PARAM_ITEM>
 
37
        <PARAM_NAME>a1,...,an</PARAM_NAME>
 
38
        <PARAM_DESCRIPTION>
 
39
          <SP>: Specifies the data to be converted and printed according to the format parameter.</SP>
 
40
        </PARAM_DESCRIPTION>
 
41
      </PARAM_ITEM>
 
42
    </PARAM_INDENT>
 
43
  </PARAM>
 
44
  <DESCRIPTION>
 
45
    <P>
 
46
    The <VERB>mprintf</VERB>, <VERB>mfprintf</VERB>, and <VERB>msprintf</VERB> functions are interface for C-coded version of <VERB>printf</VERB>, <VERB>fprintf</VERB> and
 
47
    <VERB>sprintf</VERB> functions.</P>
 
48
    <P>
 
49
    The <VERB>mprintf</VERB> function 
 
50
    writes formatted operands to the standard Scilab output
 
51
    (i.e the Scilab window). The  argument operands are formatted under control
 
52
    of the format operand.</P>
 
53
    <P>
 
54
    The <VERB>mfprintf</VERB> function writes formatted operands to the file
 
55
    specified by the file desciptor 
 
56
    <VERB>fd</VERB>. The  argument operands are formatted under control
 
57
    of the format operand.</P>
 
58
    <P>
 
59
    The <VERB>msprintf</VERB> 
 
60
    writes formatted operands in its returned value (a Scilab string).
 
61
    The  argument operands are formatted under control
 
62
    of the format operand. Note that, in this case, the  escape
 
63
    sequences (<VERB>&quot;\n, \t,..&quot;</VERB>) are treated as a normal sequence of
 
64
    characters.</P>
 
65
    <P>
 
66
    All these functions may be used to output column vectors of numbers
 
67
    and string vectors without an explicit loop on the elements. In that
 
68
    case these functions iterates on the rows. The shortest vector gives
 
69
    the number of time the format has to be iterated.</P>
 
70
    <P>
 
71
    An homogeneous sequence of identical type parameters can be
 
72
    replaced by a matrix</P>
 
73
  </DESCRIPTION>
 
74
  <EXAMPLE>
 
75
<![CDATA[
 
76
mprintf('At iteration %i, Result is:\nalpha=%f',33,0.535)
 
77
 
 
78
msprintf('%5.3f %5.3f',123,0.732)
 
79
msprintf('%5.3f\n%5.3f',123,0.732)
 
80
 
 
81
A=rand(5,2);
 
82
// vectorized forms: the format directive needs 
 
83
// two operand, each column of A is used as an operand. 
 
84
// and the mprintf function is applied on each row of A 
 
85
mprintf('%5.3f\t%5.3f\n',A)
 
86
 
 
87
colors=['red';'green';'blue';'pink';'black'];
 
88
RGB=[1 0 0;0 1 0;0 0 1;1 0.75 0.75;0 0 0];
 
89
mprintf('%d\t%s\t%f\t%f\t%f\n',(1:5)',colors,RGB)
 
90
 
 
91
 ]]>
 
92
  </EXAMPLE>
 
93
  <SEE_ALSO>
 
94
    <SEE_ALSO_ITEM>
 
95
      <LINK>mclose</LINK>
 
96
    </SEE_ALSO_ITEM>
 
97
    <SEE_ALSO_ITEM>
 
98
      <LINK>meof</LINK>
 
99
    </SEE_ALSO_ITEM>
 
100
    <SEE_ALSO_ITEM>
 
101
      <LINK>mfprintf</LINK>
 
102
    </SEE_ALSO_ITEM>
 
103
    <SEE_ALSO_ITEM>
 
104
      <LINK>fprintfMat</LINK>
 
105
    </SEE_ALSO_ITEM>
 
106
    <SEE_ALSO_ITEM>
 
107
      <LINK>mfscanf</LINK>
 
108
    </SEE_ALSO_ITEM>
 
109
    <SEE_ALSO_ITEM>
 
110
      <LINK>fscanfMat</LINK>
 
111
    </SEE_ALSO_ITEM>
 
112
    <SEE_ALSO_ITEM>
 
113
      <LINK>mget</LINK>
 
114
    </SEE_ALSO_ITEM>
 
115
    <SEE_ALSO_ITEM>
 
116
      <LINK>mgetstr</LINK>
 
117
    </SEE_ALSO_ITEM>
 
118
    <SEE_ALSO_ITEM>
 
119
      <LINK>mopen</LINK>
 
120
    </SEE_ALSO_ITEM>
 
121
    <SEE_ALSO_ITEM>
 
122
      <LINK>mprintf</LINK>
 
123
    </SEE_ALSO_ITEM>
 
124
    <SEE_ALSO_ITEM>
 
125
      <LINK>mput</LINK>
 
126
    </SEE_ALSO_ITEM>
 
127
    <SEE_ALSO_ITEM>
 
128
      <LINK>mputstr</LINK>
 
129
    </SEE_ALSO_ITEM>
 
130
    <SEE_ALSO_ITEM>
 
131
      <LINK>mscanf</LINK>
 
132
    </SEE_ALSO_ITEM>
 
133
    <SEE_ALSO_ITEM>
 
134
      <LINK>mseek</LINK>
 
135
    </SEE_ALSO_ITEM>
 
136
    <SEE_ALSO_ITEM>
 
137
      <LINK>mtell</LINK>
 
138
    </SEE_ALSO_ITEM>
 
139
    <SEE_ALSO_ITEM>
 
140
      <LINK>mdelete</LINK>
 
141
    </SEE_ALSO_ITEM>
 
142
  </SEE_ALSO>
 
143
</MAN>