isMatlabVer

버전 1.1.0.0 (6.1 KB) 작성자: Jan
Compare Matlab version number using < <= > >= ==, considers v7.10, fast Mex
다운로드 수: 404
업데이트 날짜: 2010/4/13

라이선스 보기

Compare Matlab version to specified number

In opposite to other similar functions in the FEX, this function is not confused by the version numbers 7.10 (2010a) and 7.1 (R14SP3). Also failing:
sscanf(version, '%f', 1) <= 7.8
and VERLESSTHAN published by Matlab:
http://www.mathworks.com/support/solutions/attachment.html?resid=1-3Z586O&solution=1-38LI61

This C-Mex function takes about 0.6% of the processing time needed by Matlab's VERLESSTHAN('matlab'), so it can be used in repeatedly called functions without wasting too much time.

Match = isMatlabVer(Relop, N)
INPUT:
Relop: Comparison operator as string: '<', '<=', '>', '>=', '=='.
N: Number to compare with as DOUBLE vector with 1 to 4 elements.

OUTPUT:
Match: TRUE if matching, FALSE otherwise.

EXAMPLES:
version '7.8.0.342 (R2009a)' (different results for other version!)
isMatlabVer('<=', 7) % TRUE
isMatlabVer('>', 6) % TRUE
isMatlabVer('<', [7, 8]) % FALSE
isMatlabVer('<=', [7, 8]) % TRUE
isMatlabVer('>', [7, 8, 0, 342]) % FALSE
isMatlabVer('==', 7) % TRUE
isMatlabVer('==', [7, 10]) % FALSE
isMatlabVer('>', [7, 8, 0]) % FALSE (the 342 is not considered!)
version '7.10.1.2 (2010a)':
isMatlabVer('>', [7, 2]) % TRUE

Pre-compiled files: http://www.n-simon.de/mex

Tested: Matlab 6.5, 7.7, 7.8, WinXP 32 bit, compatibility to Linux, Mac, 64 bit is assumed.
Compiler: BCC 5.5, LCC 2.4/3.8, Open Watcom 1.8, MSVC 2008

I'd appreciate suggestions for improvements and bug reports sent through email - thanks.

인용 양식

Jan (2024). isMatlabVer (https://www.mathworks.com/matlabcentral/fileexchange/27231-ismatlabver), MATLAB Central File Exchange. 검색됨 .

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

Community Treasure Hunt

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

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

New description on the FEX

1.0.0.0