当我尝试:
>>isdouble(1)
Run Code Online (Sandbox Code Playgroud)
我刚收到错误
Undefined function or variable 'isdouble'.
Run Code Online (Sandbox Code Playgroud)
另一个是*函数是一样的.但这些是Matlab中的标准函数,我甚至在使用help
或doc
函数时找到它们:
>>help isdouble
isdouble - Determine whether input is double-precision data type
This MATLAB function returns 1 when the DataType property of fi object a is
double, and 0 otherwise.
...
Run Code Online (Sandbox Code Playgroud)
那么有谁知道这里发生了什么?
小智 4
这是正常的,因为默认的MATLAB安装中没有内置函数isdouble()
等。issingle()
如果您想测试值/句柄的类,请使用isa()
内置函数,如下所示:
isa(1, 'double');
isa('abc', 'char');
Run Code Online (Sandbox Code Playgroud)