How to get the ID of MATLAB handle object?

狂风中的少年 提交于 2019-12-05 10:01:05

I have never heard of something like object HashCode in Java/C# applied to MATLAB OO. If you get address of a MATLAB object (type format debug in the command window) it is still not reasonable to use it because it will not stay same unlike in C++ but will be moved by system (managed memory).

You could manually implement an interface getHashCode() for your MATLAB objects. Unlike traditional hashcode you must make sure that your hashcode is always different for different objects - not a simple task!

MATLAB default comparer function sort apparently uses internally the object hashcode but this will not help you here - comparing objects is actually an orthogonal concept to their hashcode.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!