Export a Matrix - Maple Help

ImportMatrix

import a Matrix from a file or URL

ExportMatrix

export a Matrix to a file

 Calling Sequence ImportMatrix(f, options) ImportMatrix(url, options) ExportMatrix(f, M, options)

Parameters

 f - string or symbol; name of file where Matrix is stored url - string or symbol; URL from which to retrieve a Matrix M - Matrix or list of Matrices options - (optional) zero or more of the options described below

Options

ImportMatrix Options

 • datatype=d
 Set data type of resulting Matrix, where d is a Maple type compatible with the imported data. The default is anything.
 • direct=true or false
 When direct=true, specifies that the parameter f is not a file path but a string containing the actual data to be parsed. The default is false.
 • fill=fval
 Set the default value for entries not filled by the imported data. This can occur with delimited or csv files when one line contains fewer entries than another line elsewhere in the file. The value fval must be compatible with datatype d.
 • output=t
 Return names and Matrices, if t is all, or just Matrices, if t is matrices. This option applies to MATLAB® binary files only. The default is all.
 • skiplines=n
 Ignore n lines at the beginning of the file, where n is a non-negative integer. This option applies to text files only. The default value for n is 0.
 • source=s
 Specify data source format, where s is one of the names auto, csv, delimited, dif, Excel, MATLAB, MatrixMarket, ods, sxc, or tsv.  The default is auto, meaning ImportMatrix will attempt to infer the source format. Matlab is also accepted as a synonym for MATLAB.
 • sourceid=s
 Use a specific table from a data source supporting multiple tables. This option applies only when the source format is Excel, ods, or sxc.

ExportMatrix Options

 • target=t
 Specify data target format, where t is one of the names auto, csv, delimited, dif, Excel, MATLAB, MatrixMarket, ods, sxc, or tsv.   The default is auto, meaning ExportMatrix will attempt to infer the target format from the filename extension. Matlab is also accepted as a synonym for MATLAB.
 • arraynames=m
 Specify MATLAB® array names, where m is a string or list of strings. The default for m is "mat". This option applies to MATLAB® binary files only.

Options That Can Be Used with Both ImportMatrix and ExportMatrix

 • delimiter=s
 Specify character that separates entries in the file, where s is a string containing a single character. This option applies to text files only. The default is "\t" (Tab) except for MATLAB® ASCII files, for which it is " " (space).
 • format=f
 Specify data storage method, where f is one of the names rectangular, entries, or vectors. The default is rectangular. See details in the Overview section below.
 • transpose=t
 Indicate whether to transpose the data being imported or exported. The value of t can be true or false. The option transpose on its own is equivalent to transpose=true. The default value is false.
 • mode=m
 Specify the type of MATLAB® file. ASCII, Version 6 binary files and Version 7 binary files are supported and correspond to the following values of m respectively: ascii, v6, v7. The value binary is also accepted and is equivalent to v7.

Description

 • The ImportMatrix command imports a matrix from an external file, URL, string or ByteArray.
 • The ExportMatrix command exports a matrix or list of matrices to an external file, string, or ByteArray.
 • The type of file to be imported by ImportMatrix is specified with the source option. In some cases, the ImportMatrix command is able to detect the file type automatically and the source option may be omitted. The ImportMatrix command returns a single Matrix, or in the case of MATLAB® binary files, a sequence of lists with names and Matrices.
 • The type of file to be exported by ExportMatrix is specified with the target option. The ExportMatrix command writes the Matrix or list of Matrices to the given filename and returns the number of bytes written.
 • The parameter M to ExportMatrix must be a single Matrix unless the export format is the MATLAB® binary format, in which case a list of Matrices is also accepted.
 • The format option is available for ASCII files. This option is not applicable to MATLAB® binary files and is ignored. Three values for the format option are allowed, with rectangular being the default.
 The rectangular format means data is provided in row-major order and each line in the file represents a row in the Matrix.
 The entries format means each stored value is provided as a row-column-value triple, and the entries can appear in any order. There must be exactly three entries per line for real data and four entries per line for complex data.
 The vectors format means that a vector of row indices is provided, followed by a vector of column indices, followed by a vector of values.  If these vectors are r, c, and v, then the entries in Matrix M, which can be provided in any order, are given by ${M}_{{r}_{i},{c}_{i}}≔{v}_{i}$.
 • See the sections below for information specific to one of the supported file formats.

Details on Formats

 • The data format can be specified for ImportMatrix with the source option and for ExportMatrix with the target option.
 • The default value for both source and target is auto, in which case Maple will attempt to infer the data format from the filename or content data.

MATLAB® Binary Format

 • MATLAB® binary files are imported using the source=MATLAB option. In most cases, ImportMatrix can automatically detect binary files created in MATLAB® versions 5, 6, or 7 and the source option may be omitted. Binary files from earlier versions are not supported.
 ImportMatrix returns a sequence of lists, each containing the name of the MATLAB® array as a string and the imported Matrix. To get a sequence of Matrices only, use the output=matrices option.
 Both sparse and dense arrays can be imported. MATLAB® sparse and dense arrays are imported as Maple sparse and rectangular Matrices, respectively.  The format option is not applicable in this case.
 MATLAB® objects, cell arrays, structures and arrays with dimension greater than two cannot be imported. If any of these are detected, they are skipped over and a warning is issued.
 • A single Matrix or list of Matrices can be exported to a MATLAB® binary file using the target=MATLAB option. By default, this option generates the latest MATLAB® version supported by Maple. Currently, this is Version 7, which includes compression of the data as described on the StringTools[Compress] help page. To generate a binary file without compression that is compatible with MATLAB® Version 6, include the mode=v6 option in the calling sequence.
 ExportMatrix assigns automatically generated names to the exported Matrices and writes them as double-precision MATLAB® arrays. Only numeric data can be exported.
 Maple sparse and rectangular Matrices are exported as MATLAB® sparse and dense arrays respectively.
 The names written to the file may be specified with the arraynames=m option. If m is a list, it must have exactly n names where n is the number of Matrices in M. If m is a string and n>1, then unique names generated from m will be created.
 • The datatype and transpose options are available (the former for ImportMatrix only), but the delimiter and skiplines options are ignored. The format option is ignored.

MATLAB® ASCII Format

 • MATLAB® ASCII files are imported using the source=MATLAB and mode=ascii options. It is assumed that the MATLAB® "save ... -ascii" command was used to export the Matrix from MATLAB®. If the MATLAB® "dlmwrite" (delimited write) command was used, use the source=delimited option and see the instructions for Generic Delimited Format below.
 • A Matrix can be exported to MATLAB® ASCII format using the target=MATLAB and mode=ascii options. Only numeric data can be written. Because the MATLAB® rectangular format does not support complex numbers, use the format=entries option with complex data.
 • The default delimiter is " " (space), but an alternate delimiter can be specified. Files imported from and exported to MATLAB® look very similar to generic delimited files but there are a few differences. First, if the last entry in the Matrix is zero, then the entries format adds this entry explicitly, so that the row and column dimension can be deduced. Second, complex values are written out in "z g" format (i.e., a space between real and complex part) instead of "Zg" format (i.e., +I);
 • All options are accepted except the ones for MATLAB® binary files only. The format option does not accept the value vectors.

Matrix Market Format

 • Matrix Market files are imported using the source=MatrixMarket option. Files in Matrix Market format include a standard comment line indicating that the file contains Matrix Market data; if Maple detects such a comment line when importing a Matrix from a file, it assumes that the file is in Matrix Market format. Otherwise, a generic delimited file is assumed.
 If the imported file is in Matrix Market "coordinate" format, a sparse Matrix is returned. If the file is in "array" format, a dense (rectangular) Matrix is created. The "pattern" format is not supported. The format or delimited options are ignored by ImportMatrix.
 • With the ExportMatrix command, sparse Matrices are written in the "coordinate" format and dense Matrices are written in the "array" format. The default behavior can be changed with the format option: entries results in "coordinate" format, rectangular results in "array" format, and vectors is not accepted.
 If the Matrix contains symbolic entries, it will not fit into the predefined data types "integer", "real", or "complex"; "Maple[symbolic]" is used instead.
 • The delimiter option and the options specific to MATLAB® binary files are ignored.

Excel Format

 • The source=Excel or target=Excel causes f to be interpreted as a Microsoft Excel file. Both ImportMatrix and ExportMatrix support this format, which is autodetected when the format is unspecified and the filename ends in ".xlsx" or ".xls". Both XLSX (Office Open XML) and XLS (Excel 97-2003) file formats are supported.

DIF Format

 • The option source=dif or target=dif causes f to be interpreted as a Data Interchange Format file. Both ImportMatrix and ExportMatrix support this format, which is autodetected when the format is unspecified and the filename ends in ".dif".

ODS Format

 • The option source=ods or target=ods causes f to be interpreted as an OpenDocument Spreadsheet file. Both ImportMatrix and ExportMatrix support this format, which is autodetected when the format is unspecified and the filename ends in ".ods".

SXC Format

 • The option source=sxc or target=sxc causes f to be interpreted as a Sun XML Calc Spreadsheet file, Both ImportMatrix and ExportMatrix support this format, which is autodetected when the format is unspecified and the filename ends in ".sxc".

CSV (Comma-Separated Values) Format

 • The option source=csv or target=csv causes f to be interpreted as a Comma-Separated Values file.
 • If the source option value csv or csv[Microsoft], then ImportMatrix reads fields from a Microsoft CSV file format. Otherwise, if csv[standard] is specified, it reads fields from a standard CSV file. The result is a Matrix of objects of type string.

TSV (Tab-Separated Values) Format

 • The option source=tsv or target=tsv causes f to be interpreted as a Tab-Separated Values file.  This is equivalent to the delimited format with the delimiter set to a Tab character.  In this case the delimited option has no effect.

Generic Delimited Format

 • With ImportMatrix, if the source file format cannot be determined and the file contains numeric data, then it is assumed to be a generic delimited file. The source=delimited option can also be used to specify this information.
 Since the type of imported data is not known, the Matrix is read by using %s and then parsed. The exception to this rule is complex Matrices that have been stored by using %Zf format; they are read with %Zf format instead. For more information, see help on the scanf statement.
 • ExportMatrix assumes delimited format if the target option is not provided.
 Complex numbers are written in Zg format (i.e., + I) to make it obvious that they represent complex numbers.
 When the format=rectangular option is given, all entries are written out. When format is vectors or entries, only stored values are written out, resulting in more efficient storage for non-dense structures such as band and sparse Matrices. With symmetric Matrices having sparse[upper] or sparse[lower] storage, only half the entries are written. The program importing the data needs to be made aware of the symmetry properties of the Matrix.
 • All options except the ones specific to MATLAB® binary files are accepted and have the default values as described in the Options sections above.

Examples

 > $\mathrm{matlabFile}≔\mathrm{FileTools}:-\mathrm{JoinPath}\left(\left[\mathrm{ifelse}\left(\mathrm{kernelopts}\left(\mathrm{byteorder}\right)="little endian","example/dataLE.mat","example/dataBE.mat"\right)\right],\mathrm{base}=\mathrm{datadir}\right):$

Import a MATLAB® binary data file.

 > $A≔\mathrm{ImportMatrix}\left(\mathrm{matlabFile},\mathrm{source}=\mathrm{MATLAB}\right)$
 ${A}{≔}\left[{"mat1"}{,}\begin{array}{c}\left[\begin{array}{ccccccccccc}{-47.}& {95.}& {-49.}& {42.}& {-82.}& {71.}& {36.}& {38.}& {18.}& {-45.}& {\dots }\\ {14.}& {47.}& {9.}& {14.}& {-7.}& {-12.}& {31.}& {39.}& {-1.}& {28.}& {\dots }\\ {92.}& {82.}& {17.}& {-97.}& {-42.}& {79.}& {62.}& {27.}& {-52.}& {54.}& {\dots }\\ {40.}& {81.}& {94.}& {-98.}& {-55.}& {-68.}& {9.}& {-61.}& {67.}& {-24.}& {\dots }\\ {-56.}& {50.}& {-24.}& {28.}& {88.}& {-92.}& {19.}& {-47.}& {-63.}& {9.}& {\dots }\\ {-61.}& {85.}& {-71.}& {6.}& {96.}& {-23.}& {-49.}& {10.}& {-83.}& {8.}& {\dots }\\ {-59.}& {41.}& {-44.}& {-21.}& {-35.}& {-52.}& {-78.}& {37.}& {41.}& {-34.}& {\dots }\\ {53.}& {99.}& {-48.}& {-41.}& {9.}& {90.}& {26.}& {9.}& {88.}& {12.}& {\dots }\\ {20.}& {72.}& {47.}& {18.}& {-22.}& {42.}& {17.}& {94.}& {98.}& {73.}& {\dots }\\ {-29.}& {-69.}& {94.}& {77.}& {-21.}& {-20.}& {-80.}& {43.}& {-48.}& {50.}& {\dots }\\ {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {}\end{array}\right]\\ \hfill {\text{100 × 50 Matrix}}\end{array}\right]{,}\left[{"mat2"}{,}\begin{array}{c}\left[\begin{array}{ccccccccccc}{-32.}& {44.}& {22.}& {56.}& {-98.}& {-18.}& {89.}& {5.}& {-72.}& {-11.}& {\dots }\\ {3.}& {-8.}& {67.}& {4.}& {47.}& {-83.}& {34.}& {-2.}& {27.}& {-70.}& {\dots }\\ {-95.}& {92.}& {-43.}& {50.}& {-86.}& {-82.}& {-1.}& {-88.}& {-33.}& {38.}& {\dots }\\ {-15.}& {-16.}& {11.}& {4.}& {-25.}& {-82.}& {18.}& {-75.}& {88.}& {83.}& {\dots }\\ {17.}& {35.}& {-23.}& {41.}& {-90.}& {-20.}& {-51.}& {32.}& {-90.}& {-80.}& {\dots }\\ {-14.}& {28.}& {72.}& {88.}& {3.}& {76.}& {26.}& {98.}& {-62.}& {55.}& {\dots }\\ {-95.}& {4.}& {92.}& {-71.}& {-36.}& {-2.}& {10.}& {-34.}& {18.}& {91.}& {\dots }\\ {-27.}& {4.}& {-89.}& {-20.}& {-53.}& {-72.}& {-35.}& {-90.}& {-16.}& {75.}& {\dots }\\ {-25.}& {73.}& {-19.}& {70.}& {-7.}& {-18.}& {54.}& {-54.}& {24.}& {81.}& {\dots }\\ {66.}& {16.}& {24.}& {-2.}& {-97.}& {60.}& {92.}& {6.}& {-54.}& {-26.}& {\dots }\\ {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {}\end{array}\right]\\ \hfill {\text{18 × 40 Matrix}}\end{array}\right]$ (1)

Import the same file but return the Matrices only.

 > $A≔\mathrm{ImportMatrix}\left(\mathrm{matlabFile},\mathrm{source}=\mathrm{MATLAB},\mathrm{output}=\mathrm{matrices}\right)$
 ${A}{≔}\begin{array}{c}\left[\begin{array}{ccccccccccc}{-47.}& {95.}& {-49.}& {42.}& {-82.}& {71.}& {36.}& {38.}& {18.}& {-45.}& {\dots }\\ {14.}& {47.}& {9.}& {14.}& {-7.}& {-12.}& {31.}& {39.}& {-1.}& {28.}& {\dots }\\ {92.}& {82.}& {17.}& {-97.}& {-42.}& {79.}& {62.}& {27.}& {-52.}& {54.}& {\dots }\\ {40.}& {81.}& {94.}& {-98.}& {-55.}& {-68.}& {9.}& {-61.}& {67.}& {-24.}& {\dots }\\ {-56.}& {50.}& {-24.}& {28.}& {88.}& {-92.}& {19.}& {-47.}& {-63.}& {9.}& {\dots }\\ {-61.}& {85.}& {-71.}& {6.}& {96.}& {-23.}& {-49.}& {10.}& {-83.}& {8.}& {\dots }\\ {-59.}& {41.}& {-44.}& {-21.}& {-35.}& {-52.}& {-78.}& {37.}& {41.}& {-34.}& {\dots }\\ {53.}& {99.}& {-48.}& {-41.}& {9.}& {90.}& {26.}& {9.}& {88.}& {12.}& {\dots }\\ {20.}& {72.}& {47.}& {18.}& {-22.}& {42.}& {17.}& {94.}& {98.}& {73.}& {\dots }\\ {-29.}& {-69.}& {94.}& {77.}& {-21.}& {-20.}& {-80.}& {43.}& {-48.}& {50.}& {\dots }\\ {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {}\end{array}\right]\\ \hfill {\text{100 × 50 Matrix}}\end{array}{,}\begin{array}{c}\left[\begin{array}{ccccccccccc}{-32.}& {44.}& {22.}& {56.}& {-98.}& {-18.}& {89.}& {5.}& {-72.}& {-11.}& {\dots }\\ {3.}& {-8.}& {67.}& {4.}& {47.}& {-83.}& {34.}& {-2.}& {27.}& {-70.}& {\dots }\\ {-95.}& {92.}& {-43.}& {50.}& {-86.}& {-82.}& {-1.}& {-88.}& {-33.}& {38.}& {\dots }\\ {-15.}& {-16.}& {11.}& {4.}& {-25.}& {-82.}& {18.}& {-75.}& {88.}& {83.}& {\dots }\\ {17.}& {35.}& {-23.}& {41.}& {-90.}& {-20.}& {-51.}& {32.}& {-90.}& {-80.}& {\dots }\\ {-14.}& {28.}& {72.}& {88.}& {3.}& {76.}& {26.}& {98.}& {-62.}& {55.}& {\dots }\\ {-95.}& {4.}& {92.}& {-71.}& {-36.}& {-2.}& {10.}& {-34.}& {18.}& {91.}& {\dots }\\ {-27.}& {4.}& {-89.}& {-20.}& {-53.}& {-72.}& {-35.}& {-90.}& {-16.}& {75.}& {\dots }\\ {-25.}& {73.}& {-19.}& {70.}& {-7.}& {-18.}& {54.}& {-54.}& {24.}& {81.}& {\dots }\\ {66.}& {16.}& {24.}& {-2.}& {-97.}& {60.}& {92.}& {6.}& {-54.}& {-26.}& {\dots }\\ {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {}\end{array}\right]\\ \hfill {\text{18 × 40 Matrix}}\end{array}$ (2)
 > $\mathrm{matlabFile}≔\mathrm{FileTools}:-\mathrm{JoinPath}\left(\left["example/MatlabData.txt"\right],\mathrm{base}=\mathrm{datadir}\right):$

Import a MATLAB® ASCII data file with entries format.

 > $A≔\mathrm{ImportMatrix}\left(\mathrm{matlabFile},\mathrm{source}=\mathrm{MATLAB},\mathrm{format}=\mathrm{entries},\mathrm{transpose}=\mathrm{true}\right)$
 ${A}{≔}\begin{array}{c}\left[\begin{array}{ccccccccccc}{43}& {42}& {1}& {-97}& {-25}& {-8}& {32}& {94}& {74}& {81}& {\dots }\\ {-86}& {-6}& {62}& {82}& {58}& {78}& {-64}& {14}& {5}& {-23}& {\dots }\\ {85}& {2}& {-82}& {79}& {5}& {-81}& {3}& {99}& {-39}& {-70}& {\dots }\\ {-84}& {-20}& {83}& {2}& {61}& {-59}& {-22}& {-2}& {41}& {22}& {\dots }\\ {-53}& {-52}& {60}& {-69}& {53}& {-34}& {-83}& {38}& {-79}& {20}& {\dots }\\ {55}& {-9}& {-62}& {45}& {70}& {-19}& {-54}& {-55}& {4}& {-61}& {\dots }\\ {18}& {-94}& {71}& {52}& {89}& {86}& {-34}& {56}& {75}& {-27}& {\dots }\\ {24}& {-27}& {-26}& {-62}& {90}& {67}& {-84}& {-89}& {-34}& {-55}& {\dots }\\ {37}& {14}& {9}& {9}& {48}& {1}& {-41}& {-85}& {-94}& {-57}& {\dots }\\ {-74}& {-42}& {-64}& {-84}& {-89}& {-82}& {-23}& {41}& {-6}& {18}& {\dots }\\ {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {}\end{array}\right]\\ \hfill {\text{525 × 350 Matrix}}\end{array}$ (3)

Export the previous data as MATLAB® target with rectangular format.

 > $\mathrm{ExportMatrix}\left(\mathrm{matlabData},A,\mathrm{target}=\mathrm{MATLAB},\mathrm{format}=\mathrm{rectangular},\mathrm{mode}=\mathrm{ascii}\right)$
 ${625180}$ (4)

Use the skiplines option to skip lines at the beginning of the source data.

 > $\mathrm{ImportMatrix}\left(\mathrm{matlabData},\mathrm{source}=\mathrm{MATLAB},\mathrm{skiplines}=30\right)$
 $\begin{array}{c}\left[\begin{array}{ccccccccccc}{9}& {-25}& {92}& {-99}& {-90}& {92}& {-53}& {-51}& {16}& {-94}& {\dots }\\ {-58}& {54}& {29}& {-16}& {98}& {-33}& {46}& {85}& {49}& {13}& {\dots }\\ {4}& {54}& {-48}& {92}& {91}& {-71}& {33}& {-37}& {-50}& {26}& {\dots }\\ {29}& {-35}& {-61}& {24}& {92}& {22}& {29}& {64}& {-66}& {12}& {\dots }\\ {-46}& {36}& {57}& {66}& {98}& {28}& {66}& {-46}& {76}& {21}& {\dots }\\ {66}& {-83}& {-76}& {11}& {28}& {50}& {59}& {-71}& {-71}& {62}& {\dots }\\ {12}& {49}& {-50}& {39}& {-27}& {36}& {26}& {-23}& {-69}& {2}& {\dots }\\ {-9}& {66}& {52}& {-96}& {31}& {52}& {61}& {49}& {76}& {-83}& {\dots }\\ {-95}& {-81}& {64}& {-48}& {-32}& {-95}& {-74}& {-7}& {-24}& {77}& {\dots }\\ {-3}& {93}& {92}& {41}& {-13}& {97}& {-6}& {-45}& {-98}& {-34}& {\dots }\\ {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {}\end{array}\right]\\ \hfill {\text{495 × 350 Matrix}}\end{array}$ (5)
 > $\mathrm{delimitedFile}≔\mathrm{FileTools}:-\mathrm{JoinPath}\left(\left["example/example.del"\right],\mathrm{base}=\mathrm{datadir}\right):$

Use the delimiter option to specify the data delimiter.

 > $\mathrm{ImportMatrix}\left(\mathrm{delimitedFile},\mathrm{delimiter}="",\mathrm{datatype}=\mathrm{string}\right)$
 $\begin{array}{c}\left[\begin{array}{ccccccc}{"Country"}& {"GDP"}& {"GDPpc"}& {"LifeExp."}& {"Persons/MD"}& {"InfantMort."}& {"Literacy%"}\\ {"Algeria"}& {"42.00"}& {"1570"}& {"69"}& {"1062"}& {"52"}& {"0.52"}\\ {"Angola"}& {"5.10"}& {"950"}& {"48"}& {"15136"}& {"145"}& {"0.40"}\\ {"Argentina"}& {"112.00"}& {"3400"}& {"75"}& {"326"}& {"29"}& {"0.95"}\\ {"Australia"}& {"294.00"}& {"16700"}& {"81"}& {"438"}& {"7"}& {"0.99"}\\ {"Austria"}& {"141.00"}& {"18000"}& {"80"}& {"327"}& {"7"}& {"0.99"}\\ {"Bangladesh"}& {"23.80"}& {"200"}& {"55"}& {"5264"}& {"107"}& {"0.47"}\\ {"Barbados"}& {"1.80"}& {"7000"}& {"77"}& {"1042"}& {"20"}& {"0.99"}\\ {"Belgium"}& {"178.00"}& {"17800"}& {"80"}& {"298"}& {"7"}& {"0.98"}\\ {"Belize"}& {"0.37"}& {"1635"}& {"70"}& {"2021"}& {"36"}& {"0.93"}\\ {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}\end{array}\right]\\ \hfill {\text{93 × 7 Matrix}}\end{array}$ (6)
 > $\mathrm{csvFile}≔\mathrm{FileTools}:-\mathrm{JoinPath}\left(\left["example/timedata.csv"\right],\mathrm{base}=\mathrm{datadir}\right)$
 ${\mathrm{csvFile}}{≔}{"/maple/cbat/active/169462/data/example/timedata.csv"}$ (7)

This illustrates the use of the CSV file formats.

 > $\mathrm{ImportMatrix}\left(\mathrm{csvFile}\right)$
 $\begin{array}{c}\left[\begin{array}{cccccc}{"Mar 06 01:16"}& {"3/7/2005"}& {26.86091241}& {1.414301472}{×}{{10}}^{{7}}& {1.505894402}{×}{{10}}^{{7}}& {0.0648}\\ {"Mar 06 20:12"}& {"3/7/2005"}& {25.75624181}& {2.358229695}{×}{{10}}^{{7}}& {2.497614407}{×}{{10}}^{{7}}& {0.0591}\\ {"Mar 06 20:43"}& {"3/7/2005"}& {25.12706428}& {3.029212316}{×}{{10}}^{{7}}& {3.314477184}{×}{{10}}^{{7}}& {0.0942}\\ {"Mar 07 00:25"}& {"3/7/2005"}& {25.12249095}& {2.496855419}{×}{{10}}^{{7}}& {2.656019993}{×}{{10}}^{{7}}& {0.0637}\\ {"Mar 07 00:44"}& {"3/7/2005"}& {22.75919276}& {2.722498752}{×}{{10}}^{{7}}& {2.818590004}{×}{{10}}^{{7}}& {0.0353}\\ {"Mar 07 00:59"}& {"3/7/2005"}& {22.20631112}& {9.859010832}{×}{{10}}^{{7}}& {1.029975998}{×}{{10}}^{{7}}& {0.0447}\\ {"Mar 08 00:15"}& {"3/8/2005"}& {22.11477298}& {8.333640321}{×}{{10}}^{{7}}& {8.579230226}{×}{{10}}^{{7}}& {0.0295}\\ {"Mar 08 00:16"}& {"3/8/2005"}& {21.41227113}& {1.174272859}{×}{{10}}^{{7}}& {1.217998806}{×}{{10}}^{{7}}& {0.0372}\\ {"Mar 08 00:16"}& {"3/8/2005"}& {21.33253315}& {4.950350549}{×}{{10}}^{{6}}& {5.239008009}{×}{{10}}^{{7}}& {0.0583}\\ {"Mar 08 00:16"}& {"3/8/2005"}& {20.62752309}& {1.765508208}{×}{{10}}^{{7}}& {1.870092003}{×}{{10}}^{{7}}& {0.0592}\\ {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}\end{array}\right]\\ \hfill {\text{28 × 6 Matrix}}\end{array}$ (8)

Compatibility

 • The ExportMatrix command was updated in Maple 18.
 • The url parameter was introduced in Maple 18.
 • The sourceid option was introduced in Maple 18.
 • The source and target options were updated in Maple 18.