FromMatFile

This block reads in data from a Matfile and then outputs the data as a signal.

    FromMatFile

Library

Activate/SignalImporters

Description

The FromMatFile block reads in data from a Matfile and then outputs the data as a signal.

Then the original signal fed to the ToMatFile can be reconstructed by FromMatFile block.

As long as the signal names are correct and their values have correct sizes, any MAT file can be successfully read.

If the block is activated by external activation and time stamp is also defined, the output are displayed at event activation times. The external activation may be turned off, if time instants are provided.

Parameters

FromMatFile_0

NameLabelDescriptionData TypeValid Values

fname

File name

Defines the name (path and full name, in between quotes) of the input .mat file.

String

timename

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.

String

nout

Number of outputs

Number of data channels to be read in the MAT file.
Their dimension must be consistent with the dimension on the Time variable.

Number

outports

Output port parameters

Structure

outports/varname

Variable name

Cell of strings

outports/outsize

Output port size

Cell of matrices

outports/ot

Datatype

Cell of strings

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

outevent

Generate events at time instants

This parameter defines if the block generates an activation event. When OutEvent is used, a additional event output port is added to the block. default is OFF.

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

FromMatFile_1

NameLabelDescriptionData TypeValid Values

Buffer

Buffer size

Scalar

Method

Interpolation Method

Defines how the data read in is interpolated. Options are "zero order" or "linear".

String

'ZeroOrder(floor)'
'ZeroOrder(ceil)'
'ZeroOrder(nearest)'
'Linear'
'Not_a_knot'
'Natural'
'Clamped_To_Zero'
'Akima'
'Fritsch_Butland'
'Steffen'

Leftside

Behavior before the data time span

String

'Zero'
'Hold'
'Extrapolation'
'Repeat'

Rightside

Behavior after the data time

String

'Zero'
'Hold'
'Extrapolation'
'Repeat'

Ports

NameTypeDescriptionIO TypeNumber

Port 1

explicit

output

nout

Port 2

activation

input

externalActivation

Port 3

activation

output

outevent

Advanced Properties

NameValueDescription

always active

no

Time Dependency = standard mode activated

direct-feedthrough

no

zero-crossing

no

mode

no

continuous-time state

no

discrete-time state

no

See Also