Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
slref.pdf
Скачиваний:
39
Добавлен:
26.03.2015
Размер:
16.01 Mб
Скачать

10 Model Advisor Checks

Check for calls to slDataTypeAndScale

Identify calls to the internal function slDataTypeAndScale.

Description

In some previous versions of Simulink, opening a model that had been saved in an earlier version triggers an automatic upgrade to code for data type handling. The automatic upgrade inserts calls to the internal function slDataTypeAndScale. Although Simulink continues to support some uses of the function, if you eliminate calls to it, you get cleaner and faster code.

Simulink does not support calls to slDataTypeAndScale when:

The first argument is a Simulink.AliasType object.

The first argument is a Simulink.NumericType object with property IsAlias set to true.

Running Check for calls to slDataTypeAndScale identifies calls to slDataTypeAndScale that are required or recommended for replacement. In most cases, running the check and following the recommended action removes the calls. You can ignore calls that remain. Run the check unless you are sure there are not calls to slDataTypeAndScale.

Results and Recommended Actions

 

Condition

Recommended Action

 

 

Required Replacement

Manually or automatically replace calls to

 

 

Cases

slDataTypeAndScale. Cases listed require you

 

 

 

to replace calls to slDataTypeAndScale.

 

 

Recommended

For the listed cases, it is recommended that

 

 

Replacement Cases

you manually or automatically replace calls to

 

 

 

slDataTypeAndScale.

 

 

Manual Inspection Cases

Inspect each listed case to determine whether it

 

 

 

should be manually upgraded.

 

10-30

Simulink® Checks

Tips

Do not manually insert a call to slDataTypeAndScale into a model. The function was for internal use only.

Running Check for calls to slDataTypeAndScale calls the Simulink function slRemoveDataTypeAndScale. Calling this function directly provides a wider range of conversion options. However, you very rarely need more conversion options.

See Also

For more information about upgrading data types and scales, in the MATLAB Command Window, execute the following:

help slDataTypeAndScale

help slRemoveDataTypeAndScale

10-31

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]