Scilab 6.0.0
- Scilab Help
- Files : Input/Output functions
- Directory
- Paths - Filenames
- copyfile
- deletefile
- dispfiles
- fileinfo
- findfiles
- fprintfMat
- fscanfMat
- getURL
- getmd5
- %io
- isfile
- listfiles
- listvarinfile
- mclearerr
- mclose
- mdelete
- meof
- merror
- mfprintf
- mfscanf
- mget
- mgetl
- mgetstr
- mopen
- movefile
- mput
- mputl
- mputstr
- mseek
- mtell
- newest
- save format
- scanf
- scanf_conversion
Scilab Help >> Files : Input/Output functions > mputl
mputl
writes strings in a text file
Syntax
r = mputl(txt, file_desc)
Arguments
- r
returns
%t
or%f
to check if function has correctly wrote on the file.- file_desc
a character string giving the name of the file or
an integer scalar: a file descriptor returned by
mopen
function.- txt
a vector of strings.
Description
mputl
function allows to write a vector of
strings as a sequence of lines in a text file.
mputl
supports strings encoded as ANSI/ASCII and UTF-8.
Examples
See Also
- mget — reads byte or word in a given binary format and converts to a double type
- mgetl — reads lines from an text file
- mclose — closes an opened file
- mfprintf — converts, formats, and writes data to a file
- mput — writes byte or word in a given binary format
- mputstr — writes a character string in a file
- mopen — opens a file in Scilab
- write — write in a formatted file
Comments
content = [
"1 2 3 4"
];
filename = fullfile(TMPDIR,"data.txt");
mputl(content,filename);
By the way, the examples should not use the "/" as the delimitor, which is confusing (even if the example works perfectly on Windows).
fd = mopen(fullfile(TMPDIR,'text_mputl.txt'),'wt');
mputl('Hello World',fd);
mclose(fd);
Add a comment:
Please login to comment this page.