ToCSV

This block writes data into a CSV file. The first line of the CSV file must include the variable names, and the first variable name should be "time".

    ToCSV

Library

Activate/SignalExporters

Parameters

ToCSV_0

NameLabelDescriptionData TypeValid Values

fname

CSV Filename

Name of the CSV file.

String

nin

Number of exported variables

Number of variables that should be exported to the CSV file.

Number

inports

Variable selection

Structure

inports/varname

Variable name

Cell of strings

inports/vardatatype

Datatype

Cell of strings

'double'
'int32'
'int16'
'int8'
'uint32'
'uint16'
'uint8'
'boolean'

Separator

CSV file separator character

Separator or delimiter of the CSV file. Default: ','.

String

SubS

Sub-sampling rate

Reduces the number of data points exported by a factor. Default: 1.

Scalar

addTime

Name of the first column

If the name is omitted, a time column will not be added to the CSV file.

String

quotedNames

Variable names should be quoted

Number

0
1

externalActivation

External activation

Specifies whether the block receives an external activation or inherits its activation through its regular input ports. When External Activation is selected, an additional activation port is added to the block. By default, external activation is not selected.

Number

0
1

append

Append data

Append data to the end of an existing CSV file.

Number

0
1

increasingTime

Strictly-increasing time

Select to create a strictly-increasing time sequence.

Number

0
1

BufferSize

Buffer size

Scalar

Ports

NameTypeDescriptionIO TypeNumber

Port 1

explicit

input

nin

Port 2

activation

input

externalActivation

Advanced Properties

NameValueDescription

always active

no

direct-feedthrough

yes

zero-crossing

no

mode

no

continuous-time state

no

discrete-time state

no