sign
对数组执行符号函数(signum 函数)
说明
示例
查找符号函数
查找 fi
对象的符号函数。
sign(fi(2))
ans = int8 1
查找有符号 fi
向量的符号函数。
v = fi([-11 0 1.5],1); sign(v)
ans = 1×3 int8 row vector -1 0 1
查找无符号 fi
向量的符号函数。
u = fi([-11 0 1.5],0); sign(u)
ans = 1×3 int8 row vector 0 0 1
输入参数
a
— 输入数组
标量 | 向量 | 矩阵 | 多维数组
输入数组,指定为 fi
标量、向量、矩阵或多维数组。
sign
不支持复数 fi
输入。
数据类型: fi
扩展功能
C/C++ 代码生成
使用 MATLAB® Coder™ 生成 C 代码和 C++ 代码。
HDL 代码生成
使用 HDL Coder™ 为 FPGA 和 ASIC 设计生成 VHDL、Verilog 和 SystemVerilog 代码。
版本历史记录
在 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)