Enables zero-crossing detection.
The Zero-Crossing Detection
parameter applies only if the Sample time parameter is
set to 0
(continuous).
Simulink uses a technique known as zero-crossing detection to locate a
discontinuity in time stamps, without resorting to excessively small time
steps. “Zero-crossing” represents a discontinuity.
For the From File block, zero-crossing detection occurs
only at time stamps in the file. Simulink examines only the time stamps, not the data values.
For bus signals, Simulink detects zero-crossings across all leaf bus elements.
If the input array contains duplicate time stamps (more than one entry
with the same time stamp), Simulink detects a zero crossing at those time stamps. For example,
suppose that the input array has this data.
time: 0 1 2 2 3
signal: 2 3 4 5 6
At time 2, there is a zero crossing from the input signal
discontinuity.
For nonduplicate time stamps, zero-crossing detection depends on the
settings of these parameters:
Data extrapolation before first data
point
Data interpolation within time range
Data extrapolation after last data
point
The From File block determination of when zero-crossing
occurs depends on the time stamp.
Time Stamp | Setting |
---|
First | Data extrapolation before first data
point is set to Ground
value . |
Between first and last | Data interpolation within time
range is set to Zero-order
hold . |
Last | One or both of these settings apply: |
This figure illustrates zero-crossing detection for data accessed by a
From File block that has these settings:
Data extrapolation before first data point
— Linear extrapolation
Data interpolation within time range (for
internal points) — Zero order
hold
Data extrapolation after last data point
— Linear extrapolation
This figure is another illustration of zero-crossing detection for data
accessed by a From File block. The block has the following
settings for the time stamps (points):
Data extrapolation before first data
point — Hold first
value
Data interpolation within time range
— Zero order hold
Data extrapolation after last data point
— Hold last value
Dependencies
To generate code that builds ERT or GRT targets or uses SIL or PIL
simulation modes, clear this check box. For more information on C/C++
code generation with the From File block, see Code Generation.
Programmatic Use
Block Parameter:
ZeroCross |
Type: character vector |
Values:
'off' | 'on' |
Default:
'on' |