ToMatFile

This block exports Activate data as a MAT file.

    ToMatFile

Library

Activate/SignalExporters

Description

The ToMatFile block exports Activate data to a MAT file. At simulation instant chosen in Advanced tab, the time and the variable values are saved in the MAT file.

The lengths of the time element and variable element are identical.

The created MAT file can be read by the FromMatFile block or any tool capable of reading a MAT file.

The FromMatFile block can regenerate the original signal fed to the ToMatFile block.

Parameters

ToMatFile_0

NameLabelDescriptionData TypeValid Values

fname

Matfile name

Name of the MAT file.

String

tvarname

Time variable name

Name of the variable in the data structure that contains the time values. If no name is provided, the time variable is not exported. In this case, the external activation should be enabled to store data at event instants.

String

nin

Number of inputs

Number of data channels to be writte in the MAT file.

Number

inports

Output port parameters

Structure

inports/varnam

Variable name

Cell of strings

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.

Scalar

0
1

ToMatFile_1

NameLabelDescriptionData TypeValid Values

subsample

Sub-sampling rate

Sub sampling rate should be greater than 1.

Scalar

increasingTime

Strictly-increasing time

Select for the block to create a strictly-increasing time sequence.

Number

0
1

matfileversion

Matfile version

Version of the MAT file. Available options are 5 (default) and 7.3.

String

'5'
'7.3'

Compressed

Generate a compressed Matfile

Default is ON.

Scalar

0
1

R_MP

Register mesh points

Register the continuous time step. Event code is 0.

Number

0
1

R_DE

Register discrete events

Register the discrete time event. Event code is 1.

Number

0
1

R_MPLL

Register left limit of discrete events

Register the event just before a discrete event. Event code is -1.

Number

0
1

R_ZCLL

Register left limit of zero crossings

Register the event just before a zero crossing event. Event code is 4.

Number

0
1

R_TRY

Register try points

Register the events in try phase. Event code is 2 or 3.

Number

0
1

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

yes

See Also