This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.

Constant Ramp

Generate ramp signal with length based on input dimensions


Signal Operations



The Constant Ramp block generates the constant ramp signal

y = (0:L-1)*m + b

where m is the slope specified by the scalar Slope parameter, and b is the y-intercept specified by the scalar Offset parameter.

For an unoriented vector input, L is equal to the length of the input vector. For an N-D input array, the length L of the output ramp is equal to the length of the input in the dimension specified by the Ramp length equals number of or Dimension parameter. The output, y, is always an unoriented vector.

Dialog Box

The Main pane of the Constant Ramp block dialog appears as follows.

Ramp length equals number of

Specify whether the length of the output ramp is the number of rows, number of columns, or the length of the specified dimension of the input.


Specify the one-based dimension of the input array that determines the length of the output ramp.

This parameter is only visible when you select Elements in specified dimension for the Ramp length equals number of parameter.


Specify the scalar slope of the ramp.


Specify the scalar y-intercept of the ramp.

The Data Types pane of the Constant Ramp block dialog appears as follows.

Output data type

Specify the output data type for this block. You can select one of the following:

  • A rule that inherits a data type, for example, Inherit: Same as input.

  • A built in data type, such as double

  • An expression that evaluates to a valid data type, for example, fixdt(1,16)

Click the Show data type assistant button to display the Data Type Assistant, which helps you set the Output data type parameter.

See Control Signal Data Types (Simulink) for more information.

Supported Data Types

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point

  • 8-, 16-, and 32-bit signed integers

  • 8-, 16-, and 32-bit unsigned integers

This block differs from other DSP System Toolbox™ blocks in that unless you choose Same as input for the Output data type parameter, the data types of the input and the output do not need to be the same.

See Also

Create Diagonal MatrixDSP System Toolbox
Identity MatrixDSP System Toolbox

Introduced before R2006a

Was this topic helpful?