isinf
确定哪些数组元素为无限值
说明
示例
确定无限实数元素
创建一个行向量并确定无限元素。
A = 1./[-2 -1 0 1 2]
A = 1×5
-0.5000 -1.0000 Inf 1.0000 0.5000
TF = isinf(A)
TF = 1x5 logical array
0 0 1 0 0
确定无限复数元素
创建一个复数数组。确定这些复数中是否包含无限值。
A = [2 + 1i, 3 + 1i/0, 0/0 - 2i]
A = 1×3 complex
2.0000 + 1.0000i 3.0000 + Infi NaN - 2.0000i
TF = isinf(A)
TF = 1x3 logical array
0 1 0
A
的第二个元素具有无限虚部。对于此元素,isinf
返回 1。
输入参数
A
— 输入数组
标量 | 向量 | 矩阵 | 多维数组
输入数组,指定为标量、向量、矩阵或多维数组。
提示
如果
x
是实数标量,则isfinite(x)
、isinf(x)
和isnan(x)
中只有一个返回逻辑值1
(true
)。对于复数标量
z
,isinf(z)
和isnan(z)
都可以返回逻辑值 1。例如,isinf(complex(Inf,NaN))
和isnan(complex(Inf,NaN))
都返回逻辑值 1。
扩展功能
tall 数组
对行数太多而无法放入内存的数组进行计算。
此函数完全支持 tall 数组。有关详细信息,请参阅 tall 数组。
C/C++ 代码生成
使用 MATLAB® Coder™ 生成 C 代码和 C++ 代码。
HDL 代码生成
使用 HDL Coder™ 为 FPGA 和 ASIC 设计生成 Verilog 代码和 VHDL 代码。
基于线程的环境
使用 MATLAB® backgroundPool
在后台运行代码或使用 Parallel Computing Toolbox™ ThreadPool
加快代码运行速度。
此函数完全支持基于线程的环境。有关详细信息,请参阅Run MATLAB Functions in Thread-Based Environment。
GPU 数组
通过使用 Parallel Computing Toolbox™ 在图形处理单元 (GPU) 上运行来加快代码执行。
此函数完全支持 GPU 数组。有关详细信息,请参阅Run MATLAB Functions on a GPU (Parallel Computing Toolbox)。
分布式数组
使用 Parallel Computing Toolbox™ 在集群的组合内存中对大型数组进行分区。
此函数完全支持分布式数组。有关详细信息,请参阅Run MATLAB Functions with Distributed Arrays (Parallel Computing Toolbox)。
版本历史记录
在 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)