MxArrayDefinition

版本 1.0.0.0 (17.0 KB) 作者: Andrew
Creates a C style definition of an mxArray (for use in mex applications)
475.0 次下载
更新时间 2014/5/1

查看许可证

This function attempts to programmatically determine a suitable definition of the mxArray structure. This is intended to allow the user explore the workings of MATLAB's mxArray, and to facilitate using undocumented methods in MEX functions.
This function analyses the mxArray by first finding its size, and then examines changes to the bytes of mxArray after the mxArray is modified in MATLAB. In some cases the byte pattern from two mxArrays are compared to determine which mxArray properties are represented by which bytes. The approach was motivated the method described at:
http://undocumentedmatlab.com/blog/matlabs-internal-memory-representation

Due to the may it works, it may fail to find members of the mxArray occasionally. If it missed something, try it again xD.

The output should look like the examples included: mxInternals_R2010A.h and mxInternals_R2013B.h

WARNING: This function attempts to read data from memory pointers that may not been valid - this may crash MATLAB, so SAVE ALL WORK BEFORE RUNNING. If that happens - don't panick, just restart Matlab and try again. It has been tested for:
R2013B
R2012B
R2010A
(some windows, some unix).

DISCLAIMER - This function has NOT been tested on a BIG endian machine. While I've attempted to make the program compatible with big endian machines, I can't test it. So if you have one, I'd love to know if it works!

ACKNOWLEDGEMENTS
The early mxArray investigation done by
Peter Boetcher, James Tursa, Bruno Luong, Joshua Dillon and all else involved.
Yair Altman, Peter Li, and "Martin":
http://undocumentedmatlab.com/blog/matlabs-internal-memory-representation

引用格式

Andrew (2024). MxArrayDefinition (https://www.mathworks.com/matlabcentral/fileexchange/46427-mxarraydefinition), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2013b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Write C Functions Callable from MATLAB (MEX Files) 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0