wrapToInterval()

버전 1.0.2 (150 KB) 작성자: Adam Danz
Wraps numeric values to a specified interval.
다운로드 수: 106
업데이트 날짜: 2021/3/28

라이선스 보기

Wrapping numbers to an interval is not difficult and can be done with 1 line of code depending on the interval type. This function adds flexibility to this process by letting the user specify the interval type (open|closed) and by supporting the use of +/-inf in the interval.

xwrap = wrapToInterval(x, [a,b])
wraps values in x to the interval [a,b] resulting in [a <= xwrap < b].

wrapToInterval(x, [a,b], intervalType)
specifies interval type:
------ 'openright' -- results in [a <= xwrap < b]
------ 'openleft' -- results in [a < xwrap <= b]
------ 'closed' -- results in [a <= xwrap <= b]

wrapToInterval(__, plotflag)
produces a scatter plot comparison between x and xwrap.

Also see Matlab's related functions: MOD REM WRAPTOPI WRAPTO2PI WRAPTO180 WRAPTO360

인용 양식

Adam Danz (2024). wrapToInterval() (https://www.mathworks.com/matlabcentral/fileexchange/89506-wraptointerval), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2021a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux

Community Treasure Hunt

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

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

Minor format changes to mlx file only.

1.0.1

Updated source URL.

1.0.0