isfunction(FUN)

버전 3.2.0.0 (2.5 KB) 작성자: Jos (10584)
returns true for valid matlab functions (v3.2, apr 2018)
다운로드 수: 521
업데이트 날짜: 2018/4/9

라이선스 보기

TF = ISFUNCTION(FUN) returns 1 if FUN is a valid matlab function, and 0 otherwise. Matlab functions can be strings or function handles.

[TF, ID] = ISFUNCTION(FUN) also returns an identier ID. ID can take the following values:
1 : FUN is a function string
2 : FUN is a function handle
0 : FUN is not a function, but no further specification
-1 : FUN is a script
-2 : FUN is not a valid function m-file (e.g., a matfile)
-3 : FUN does not exist (as a function)
-4 : FUN is not a function but something else (a variable)

FUN can also be a cell array, TF and ID will then be arrays.

Examples:
tf = isfunction('lookfor')
% tf = 1
[tf, id] = isfunction({@isfunction, 'sin','qrqtwrxxy',1:4, @clown.jpg})
% -> tf = [ 1 1 0 0 0 ]
% id = [ 2 1 -2 -4 -3 ]

See also function, script, exist, isa, which, nargin, function_handle

인용 양식

Jos (10584) (2024). isfunction(FUN) (https://www.mathworks.com/matlabcentral/fileexchange/45778-isfunction-fun), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2017b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Argument Definitions에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
3.2.0.0

fixed spelling

1.0.0.0