CCustomBlock

This is a customizable block that you can define in C language.

    CCustomBlock

Library

Activate/CustomBlocks

Description

The CCustomBlock block provides a generic interface for specifying the block properties and defining the block simulation function. The simulation function is specified in C code and is stored as a block parameter. The code is compiled and used automatically at the start of the simulation.

For more details, see the Extended Definitions for Advanced Users.

Parameters

CCustomBlock_0

NameLabelDescriptionData TypeValid Values

nin

Number of input ports

Number

inports

Input ports parameters

Structure

inports/inrow

Row size

Cell of scalars

inports/incol

Column size

Cell of scalars

inports/it

Type

Cell of strings

'double'
'complex'
'int64'
'int32'
'int16'
'int8'
'uint64'
'uint32'
'uint16'
'uint8'
'boolean'
'pointer'
'inherit'

inports/depu

Feedthrough

Cell of scalars

0
1

inports/name

Name

Cell of strings

nevin

Number of input event ports

Number

nout

Number of output ports

Number

outports

Output port parameters

Structure

outports/outrow

Row size

Cell of scalars

outports/outcol

Column size

Cell of scalars

outports/ot

Type

Cell of strings

'double'
'complex'
'int64'
'int32'
'int16'
'int8'
'uint64'
'uint32'
'uint16'
'uint8'
'boolean'
'pointer'
'inherit'

outports/name

Name

Cell of strings

nevout

Number of output event ports

Number

evoutports

Initial firing values

Structure

evoutports/fir

Firing(<0 for no firing)

Cell of scalars

CCustomBlock_1

NameLabelDescriptionData TypeValid Values

xx

Initial continuous state

Vector

xd

Initial state derivative

Vector

z

Initial discrete state

Vector

noz

Number of initial object states

Number

ozparams

Initial object states

Structure

ozparams/oztyp

Type

Cell of strings

'double'
'complex'
'int64'
'int32'
'int16'
'int8'
'uint64'
'uint32'
'uint16'
'uint8'
'int64'
'uint64'
'boolean'

ozparams/ozvalue

Value

Cell of matrices

ozparams/name

Name

Cell of strings

CCustomBlock_2

NameLabelDescriptionData TypeValid Values

rpar

Real parameters vector

Vector

ipar

Integer parameters vector

Vector

nopar

Number of object parameters

Number

oparparams

Object parameters

Structure

oparparams/opartyp

Type

Cell of strings

'double'
'complex'
'int64'
'int32'
'int16'
'int8'
'uint64'
'uint32'
'uint16'
'uint8'
'boolean'
'int64'
'uint64'
'string'

oparparams/oparvalue

Value

oparparams/name

Name

Cell of strings

CCustomBlock_3

NameLabelDescriptionData TypeValid Values

inlined

Inlined C code

Number

0
1

code

Function code

String

fcn

Function

Structure

fcn/slib

Shared library path

Cell of strings

fcn/epoint

Entry point

Cell of strings

impl

Implicit block (function)

Number

0
1

nincludepath

Number of Include paths

Number

includepath

Include paths

Structure

includepath/path

Include Path

Cell of strings

ndefine

Number of Defines

Number

define

Defines

Structure

define/path

Define

Cell of strings

ncompileflags

Number of compiler flags

Number

compileflags

Compiler Flags

Structure

compileflags/path

Compiler flag

Cell of strings

nlibpath

Number of library paths

Number

libpath

Library paths

Structure

libpath/path

Library path

Cell of strings

nlibs

Number of libraries

Number

libs

Libraries

Structure

libs/path

Library name

Cell of strings

CCustomBlock_4

NameLabelDescriptionData TypeValid Values

nmode

Number of modes

Scalar

nzcr

Number of zero-crossings

Scalar

dept

Activation mode

String

'Always
Active
mode'
'Initially
Active
mode'
'Standard
mode'

Ports

NameTypeDescriptionIO TypeNumber

Port 1

explicit

output

nout

Port 2

explicit

input

nin

Port 3

activation

input

nevin

Port 4

activation

output

nevout