Modulo

This block implements the remainder after the division function. The block provides two options: Modulo and Remainder. Modulo(u1,u2) returns u1-floor(u1/u2)*u2 and Remainder(u1,u2) returns u1-int(u1/u2)*u2

    Modulo

Library

MathOperations

Description

The Modulo block implements the remainder after the division function.

The block provides two options: Modulo and Remainder. Modulo(u1,u2) returns u1-floor(u1/u2)*u2 and Remainder(u1,u2) returns u1-int(u1/u2)*u2.

When u2 is 0, the output is considered to be u1.

The input datatype should be either double or integer.

Parameters

Modulo_0

NameLabelDescriptionData TypeValid Values

op

Function

String

'Modulo'
'Remainder'

zc

Apply zero crossing

Enables the detection of zero crossings.

Scalar

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

Ports

NameTypeDescriptionIO TypeNumber

Port 1

explicit

output

1

Port 2

explicit

The input data to be divided.

input

1

Port 3

explicit

The divisor.

input

2

Port 4

activation

input

externalActivation

Advanced Properties

NameValueDescription

always active

no

Standard mode is used.

direct-feedthrough

yes

zero-crossing

no

mode

no

continuous-time state

no

discrete-time state

no