1
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
2
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
4
<LANGUAGE>eng</LANGUAGE>
6
<TYPE>Scilab Function</TYPE>
7
<DATE>April 1993</DATE>
8
<SHORT_DESCRIPTION name="mput"> writes byte or word in a given binary format</SHORT_DESCRIPTION>
10
<CALLING_SEQUENCE_ITEM>mput(x [,type,fd]) </CALLING_SEQUENCE_ITEM>
15
<PARAM_NAME>x</PARAM_NAME>
17
<SP>: a vector of floating point or integer type numbers</SP>
21
<PARAM_NAME>fd</PARAM_NAME>
23
<SP>: scalar. The <VERB>fd</VERB> parameter returned by the function. Default value is -1 which stands for the last (<VERB>mopen</VERB>) opened file.</SP>
27
<PARAM_NAME>type</PARAM_NAME>
29
<SP>: a string. Give the binary format used to write all the entries of x.</SP>
36
The <VERB>mput</VERB> function writes data to the output specified by the
37
stream parameter <VERB>fd</VERB>. Data is written at the
38
position at which the file pointer is currently pointing and
39
advances the indicator appropriately.
42
The <VERB>type</VERB> parameter is a conversion specifier which may be set to any of the
43
following flag characters (with default value "l"):
46
<DESCRIPTION_ITEM label=""l","i","s","ul","ui","us","d","f","c","uc"">
47
<SP>: for writing respectively a long, an int, a short, an unsigned long, an unsigned int, an unsigned short, a double, a float, a char and an unsigned char. The bytes which are wrote are automatically swapped if necessary (by checking little-endian status) in order to produce machine independent binary files ( in little-endian mode). This default swapping mode can be suppressed by adding a flag in the <VERB>mopen</VERB> function.</SP>
49
<DESCRIPTION_ITEM label=""..l" or "..b"">
50
<SP>: It is also possible to write in little-endian or big-endian mode by adding a 'l' or 'b' character at the end of a type specification. For example "db" will write a double in big-endian mode.</SP>
58
mput(1996,'l');mput(1996,'i');mput(1996,'s');mput(98,'c');
59
// force little-endian
60
mput(1996,'ll');mput(1996,'il');mput(1996,'sl');mput(98,'cl');
62
mput(1996,'lb');mput(1996,'ib');mput(1996,'sb');mput(98,'cb');
66
if 1996<>mget(1,'l') then pause,end
67
if 1996<>mget(1,'i') then pause,end
68
if 1996<>mget(1,'s') then pause,end
69
if 98<>mget(1,'c') then pause,end
70
// force little-endian
71
if 1996<>mget(1,'ll') then pause,end
72
if 1996<>mget(1,'il') then pause,end
73
if 1996<>mget(1,'sl') then pause,end
74
if 98<>mget(1,'cl') then pause,end
76
if 1996<>mget(1,'lb') then pause,end
77
if 1996<>mget(1,'ib') then pause,end
78
if 1996<>mget(1,'sb') then pause,end
79
if 98<>mget(1,'cb') then pause,end
95
<LINK>fprintfMat</LINK>
101
<LINK>fscanfMat</LINK>