Skip to Main Content Skip to Search
Product Documentation

Checking Parameter Values

About Value Checking

Many blocks perform range checking of their mathematical parameters. Generally, blocks that allow you to enter minimum and maximum values check to ensure that the values of applicable parameters lie within the specified range.

Blocks That Perform Parameter Range Checking

The following blocks perform range checking for their parameters:

BlockParameters Checked

Constant

Constant value

Data Store Memory

Initial value

Gain

Gain

Interpolation Using Prelookup

Table data

1-D Lookup Table

Table data

2-D Lookup Table

Table data

n-D Lookup Table

Table data

Relay

Output when on
Output when off

Repeating Sequence Interpolated

Vector of output values

Repeating Sequence Stair

Vector of output values

Saturation

Upper limit
Lower limit

Specifying Ranges for Parameters

In general, use the Output minimum and Output maximum parameters that appear on a block parameter dialog box to specify a range of valid values for the block parameters. The following exceptions apply:

When specifying minimum and maximum values that constitute a range, enter only expressions that evaluate to a finite, scalar, real number with double data type. The default values for the minimum and maximum are [] (unspecified). The scalar values that you specify are subject to expansion, for example, when the block parameters that Simulink checks are nonscalar (see Scalar Expansion of Inputs and Parameters).

Specifying Ranges for Complex Numbers

When you specify a minimum or maximum value for a parameter that is a complex number, the specified minimum and maximum apply separately to the real part and to the imaginary part of the complex number. If the value of either part of the number is less than the minimum, or greater than the maximum, the complex number is outside the specified range. No range checking occurs against any combination of the real and imaginary parts, such as (sqrt(a^2+b^2))

Performing Parameter Range Checking

You can initiate parameter range checking in the following ways:

Simulink performs parameter range checking by comparing the values of applicable block parameters with both the specified range (see Specifying Ranges for Parameters) and the block data type. That is, Simulink performs the following check:

DataTypeMin ≤ MinValue ≤ VALUE ≤ MaxValue ≤ DataTypeMax

where

When Simulink detects a parameter value that violates the check, it displays an error message. For example, consider a model that contains a Constant block whose

In this situation, Simulink does not perform parameter range checking when you click the OK button on the Constant block dialog box because the variable const is undefined. But suppose you define its value by entering

const = 10

at the MATLAB prompt, and then you update the diagram (see Updating a Block Diagram). Simulink displays the following error message:

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS