Documentation

Signal Values

Signal Data Types

Data type refers to the format used to represent signal values internally. By default, the data type of Simulink®如果gnals is double. You can create signals of other data types. Simulink signals support the same range of data types as MATLAB®。看About Data Types in Simulinkfor more information.

信号尺寸, Size, and Width

万博1manbetxSimulink块可以输出一维,二维或多维信号。Simu万博1manbetxlink用户界面和文档通常将1-D信号称为向量以及2-D或多维信号作为矩阵。一元素阵列通常称为标量。

The size of a signal refers to the number of elements that a signal contains. The size of a matrix (2-D) signal is generally expressed as M-by-N, where M is the number of columns and N is the number of rows making up the signal. The size of a vector signal is referred to as the width of the signal.

For more information, see信号尺寸

复杂的信号

The values of signals can be complex numbers or real numbers. A signal whose values are complex numbers is a complex signal. Create a complex-valued signal using one of the following approaches:

  • Load complex-valued signal data from the MATLAB workspace into the model via a root-level企业block.

  • 创建一个持续的阻止您的模型,并将其值设置为一个复杂的数字。

  • 创建与复杂信号的真实和虚构部分相对应的真实信号,然后将零件组合成复杂的信号,并使用Real-Imag to Complexconversion block.

Manipulate complex signals via blocks that accept them. If you are not sure whether a block accepts complex signals, see the documentation for the block.

Initializing Signal Values

If a signal does not have an explicit initial value, the initial value that Simulink uses depends on the data type of the signal.

Signal Data Type Default Initial Value
Numeric (other than fixed-point) Zero
Fixed-point Real-world ground value
Boolean False
Enumerated 默认值

您可以在模拟开始时指定Simulink的信号的非默认初始值。万博1manbetx

  • 对于任何信号,您可以定义一个信号对象(万博1manbetxsimulink.signal), 和use that signal object to specify an initial value for the signal.

  • For some blocks, such as外港,数据存储存储器, 和内存, you can use either a signal object or a block parameter, or both, to specify the initial value of a block state or output.

For details, seeInitialize Signals and Discrete States

查看信号值

You can use either blocks or the signal viewers (such as the Signal & Scope Manager) to display the values of signals during a simulation. For example, you can use either the Scope block or the Signal & Scope Manager to graph time-varying signals on an oscilloscope-like display during simulation. For general information about options for viewing signal values, seeScope Blocks and Scope Viewer Overview。有关:

在模型图中显示信号值

To include graphical displays of signal values in a model diagram, use one of the following approaches:

Display Data Tips During Simulation

For many blocks, Simulink can display block output (port values) as data tips on the block diagram while a simulation is running.

  1. In the Simulink Editor, selectDisplay>Data Display in Simulation

  2. From the submenu, select eitherShow Value Labels When Hovering或者单击时显示价值标签

  3. To change display options, use theOptionssubmenu.

For details, see显示调试的端口值

Display Signal Value After Simulation

To display, below a specific signal, the signal value after simulation:

  1. Right-click the signal.

  2. In the context menu, selectShow Value Label of Selected Port

Exporting Signal Data

You can save signal values to the MATLAB workspace during simulation, for later retrieval and postprocessing. For a summary of different approaches, see导出信号数据的方法

相关话题

这个话题有帮助吗?