b = filewrite(file_handler, message『, parameter1, ..., parameterN』);
function writes one or more lines of text to the file
associated with file_handler
is either a string expression or a numeric message number
that contains the text that is written to the file. If the text contains any message formatters
, the optional parameters parameter1
will be inserted into the text. There are some additional options for file output:
- If you want to break a line of text into two lines, place \n where you want the line divided.
- If you want a text line to begin on a new page, place \f at the beginning of the text string.
- To output \n or \f as text instead of a new line or a new page, use a double backslash (e.g., \\n).
Alternatively, the message
can be a string list
. If a list is provided, then each string contained in the list is written to the file, allowing for the output of multiple lines of text with one function call.
The function returns a logical value of 1 (true) if successful and 0 (false) otherwise.