Inf 函数

Inf 函数

Infinity

无穷大

Syntax

语法

Inf

Inf('double')

Inf('single')

Inf(n)

Inf(m,n)

Inf(m,n,p,...)

Inf(...,classname)

Description

描述

Inf returns the IEEE arithmetic representation for positive infinity. Infinity results from operations like division by zero and overflow, which lead to results too large to represent as conventional floating-point values.

Inf 返回IEEE运算,表示正无穷大。无穷大结果来自运筹学像零和其他数值的除法运算,其造成了结果过大而无法使用惯用的浮点值表示。

Inf('double') is the same as Inf with no inputs.

Inf('double')是和inf不带任何输入值的情况相同。

Inf('single') is the single precision representation of Inf.

Inf('single')inf的单精度表示。

Inf(n) is an n-by-n matrix of Infs.

Inf(n)是一个infn-by-nn*n)矩阵。

Inf(m,n) or inf([m,n]) is an m-by-n matrix of Infs.

Inf(m,n)inf([m,n])是一个infm-by-nm*n)矩阵。

Inf(m,n,p,...) or Inf([m,n,p,...]) is an m-by-n-by-p-by-... array of Infs.

Inf(m,n,p,)inf([m,n,p])是一个infm-by-n-by-p-by-…阵列。

Inf(...,classname) is an array of Infs of class specified by classname. classname must be either 'single' or 'double'.

Inf(,classname)是一个通过classname的特定的classinfs阵列。classname必须被确认是'single''double'

Examples

例如:

1/0, 1.e1000, 2^2000, and exp(1000) all produce Inf. 

log(0) produces -Inf. 

Inf-Inf and Inf/Inf both produce NaN (Not-a-Number).

在MATLAB中,inf函数用于表示正无穷大量+∞。当执行MATLAB程序时,即使遇到以0为除数的运算,程序也不会终止,而是给出一个“除0”警告,并将结果赋值为inf,继续执行。例如,1/inf的结果为0。\[3\] 此外,exist函数可以用于检查MATLAB中的变量、文件、文件夹、类等是否存在。它返回不同的值来表示不同的情况。例如,如果变量或文件存在,则返回1或2;如果是MATLAB内置函数,则返回5;如果是文件夹,则返回7;如果是类,则返回8。\[2\] 请注意,inf函数和exist函数是MATLAB中的内置函数,可以直接在MATLAB命令窗口中使用。 #### 引用[.reference_title] - *1* *2* [Matlab相关函数知识点(二)-inf函数+exist函数+isfield函数](https://blog.csdn.net/absll/article/details/125048431)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [matlab基本函数inf, isempty, round, floor, fix](https://blog.csdn.net/u013555719/article/details/97649436)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值