Sign
指示输入的符号
库:
Simulink /
Math Operations
HDL Coder /
HDL Floating Point Operations
HDL Coder /
Math Operations
描述
对于实数输入,Sign 模块将输出输入的符号:
输入 | 输出 |
---|---|
大于零 | 1 |
等于零 | 0 |
小于零 | -1 |
当输入 u
为复数标量时,模块输出与 MATLAB® 结果匹配:
sign(u) = u./ abs(u) | (1) |
示例
端口
输入
Port_1 — 输入信号
标量 | 向量 | 矩阵
输入信号,其符号将决定输出。
模块仅支持浮点数据类型(即 double
和 single
)的复输入信号。
数据类型: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| Boolean
| fixed point
复数支持: 是
输出
Port_1 — 输出信号
标量 | 向量 | 矩阵
输出信号,它是输入信号的符号。
数据类型: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| Boolean
复数支持: 是
参数
启用过零检测 — 启用过零检测
on
(默认) | off
采样时间(-1 表示继承) — 采样之间的时间间隔
-1
(默认) | 标量 | 向量
指定采样时间间隔。要继承采样时间,请将此参数设置为 -1
。有关详细信息,请参阅指定采样时间。
依存关系
仅当您将此参数设置为 -1
以外的值时才可见。要了解详细信息,请参阅不建议设置采样时间的模块。
编程用法
模块参数:SampleTime |
类型:字符串标量或字符向量 |
默认值:"-1" |
模块特性
数据类型 |
|
直接馈通 |
|
多维信号 |
|
可变大小信号 |
|
过零检测 |
|
扩展功能
C/C++ 代码生成
使用 Simulink® Coder™ 生成 C 代码和 C++ 代码。
HDL 代码生成
使用 HDL Coder™ 为 FPGA 和 ASIC 设计生成 VHDL、Verilog 和 SystemVerilog 代码。
HDL Coder™ 提供影响 HDL 实现和综合逻辑的额外配置选项。
此模块具有一个默认 HDL 架构。
ConstrainedOutputPipeline | 通过移动设计中现有延迟的方式来放置在输出端的寄存器的数量。分布式流水线不会重新分发这些寄存器。默认值为 |
InputPipeline | 要在生成的代码中插入的输入流水线阶段数。分布式流水线和受限输出流水线可以移动这些寄存器。默认值为 |
OutputPipeline | 要在生成的代码中插入的输出流水线阶段数。分布式流水线和受限输出流水线可以移动这些寄存器。默认值为 |
此模块支持复信号的代码生成。
PLC 代码生成
使用 Simulink® PLC Coder™ 生成结构化文本代码。
定点转换
使用 Fixed-Point Designer™ 设计和仿真定点系统。
版本历史记录
在 R2006a 之前推出
另请参阅
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)