# $$\text{SaveBooleanMatrix}$$¶

You can use the $$\text{SaveBooleanMatrix}$$ to save a boolean matrix to a file.

You can use the \savebooleanmatrix backslash command to insert this function.

The following variants of this function are available:

• $$\text{boolean } \text{SaveBooleanMatrix} \left ( \text{<matrix>}, \text{<filename>} \right )$$

• $$\text{boolean } \text{SaveBooleanMatrix} \left ( \text{<matrix>}, \text{<filename>}, \text{<binary>} \right )$$

The $$\text{<matrix>}$$ parameter is the boolean matrix to be saved and $$\text{<filename>}$$ is the filename of the file to save the boolean matrix to. The file will be overwritten if it exists.

The $$\text{<binary>}$$ flag indicates if the file should be saved in a binary format or in CSV format. If excluded or false, the boolean matrix will be saved as a tab separated CSV file suitable for import into software packages such as Microsoft Excel. If true, the boolean matrix will be saved in a packed binary format.

Both formats can be read by Aion using the function $$\text{LoadBooleanMatrix}$$.

Note that the binary format is designed to be relatively simple for external applications to implement. For details on the binary format, see File Formats.

The Figure 166 shows how you can use the $$\text{SaveBooleanMatrix}$$ function.