Close
Close window
Export - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


[フレーム] [フレーム]

Export

export data from Maple to a file

Calling Sequence

Export(dest, data, opts)

Export(data, target=direct, opts)

Parameters

dest

-

string; file path or URL of the data file

data

-

data to be exported

opts

-

(optional) the format options as described later

Options

base : one of bindir, currentdir, datadir, homedir, mapledir, tempdir, toolboxdir, or worksheetdir.

The base option specifies a base directory. Any local file specified with dest will be interpreted as a relative path under this directory. For the meaning of each of these values, see kernelopts or interface .

encoding : one of text or binary

Specifies whether the output should be encoded using a text or binary variant of the format. This option is only effective for the PLY and STL output formats. The default is binary.

format : string

The format option specifies the export format to use. This must correspond to one of the supported export formats. If omitted, Export will attempt to infer the format from the file extension of dest. When target=direct, this option may not be omitted.

height : posint or auto

Specifies the height of a generated image. Valid only for image formats such as JPEG or PNG .

normals : truefalse

For 3-D formats such as STL , compute and include normal vectors in the exported file.

target : one of file or direct

The default target=file specifies that the data should be written to the file referenced by dest; target=direct means that the data will be exported to a string or ByteArray to be returned. Note that target=direct requires format to be provided explicitly.

width : posint or auto

Specifies the width of a generated image. Valid only for image formats such as JPEG or PNG .

Description

The Export command exports data from Maple to an external file or to a string or ByteArray in the specified file format.

When target=file (the default), the command writes the exported data to the file dest and returns a number showing the count of bytes written.

When target=direct, the data is exported to a string or ByteArray which is returned as output. Note that target=direct requires format to be provided explicitly.

For details about the types of input accepted by a particular output format, consult the documentation for that format.

Supported Formats

Examples

Export a plot to a JPEG file.

>

Exportsinefile.jpg,plotsin,base=homedir

24610

(1)

Export numeric data to a file in Comma-Separated Values (CSV) format.

>

Exportdata.csv,LinearAlgebra:-RandomMatrix50,2,base=homedir

334

(2)

Export data directly to a string in the JSON format with target=direct.

>

PersonDataRecordsurname=Turing,firstname=Alan,birth=1912年06月23日,death=1954年06月07日

PersonDataRecordsurname=Turing,firstname=Alan,birth=1912年06月23日,death=1954年06月07日

(3)
>

ExportPersonData,format=JSON,target=direct

{ "surname": "Turing", "firstname": "Alan", "birth": "1912年06月23日", "death": "1954年06月07日" }

(4)

Export the same data to a JSON file.

>

Exportturing.json,PersonData,base=homedir

88

(5)

Compatibility

The Export command was introduced in Maple 2015.

For more information on Maple 2015 changes, see Updates in Maple 2015 .

The Export command was updated in Maple 2017.

The base option was introduced in Maple 2017.

For more information on Maple 2017 changes, see Updates in Maple 2017 .


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /