이 제출물을 팔로우합니다
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다
TYPECAST and TYPECASTX are mex functions intended to mimic the MATLAB intrinsic typecast function with extensions. These C-mex versions of typecast differs from the intrinsic typecast in the following important aspects:
Intrinsic typecast
------------------
Type of copy: Deep Data Copy
Allows complex: No
Allows logical: No
Allows char: No
Allows non-vector: No
C-mex typecast
--------------
Type of copy: Shared Data Copy
Allows complex: Yes
Allows logical: Yes (cannot convert from complex)
Allows char: Yes (cannot convert from complex)
Allows non-vector: Yes
Since these C-mex functions produce a shared data copy of the original, it is more efficient than the MATLAB intrinsic typecast, which may be important if you are working with large variables. For non-vector inputs, the first non-singleton dimension must be compatible for the conversion.
There is *NO* difference in functionality between the C-mex typecast and typecastx functions. The purpose of including typecastx is so that users can have the extended functionality shown above without shadowing the intrinsic typecast. e.g., users with older versions of MATLAB that do not have a MATLAB intrinsic typecast might install both typecast and typecastx, whereas users with later versions of MATLAB that *do* have an intrinsic typecast might choose to only install the typecastx function.
Note that these C-mex functions are self-building ... you don't have to know anything about C.
인용 양식
James Tursa (2026). typecast and typecastx C-mex functions (https://kr.mathworks.com/matlabcentral/fileexchange/17476-typecast-and-typecastx-c-mex-functions), MATLAB Central File Exchange. 검색 날짜: .
도움
도움 준 파일: cachedcall, num2vpi - Converts input exactly into vpi, DataHash
| 버전 | 퍼블리시됨 | 릴리스 정보 | Action |
|---|---|---|---|
| 1.3.0.0 | Added capability for char and logical types. Added the typecastx files for convenience. |
||
| 1.2.0.0 | Fixed a sparse matrix bug. |
||
| 1.1.0.0 | Changed algorithm from deep data copy to shared data copy. Thus the C-mex typecast is more efficient than the MATLAB intrinsic typecast. Also added the capability to handle complex inputs. |
||
| 1.0.0.0 | I am adding an m-file so that "help typecast" will work. |