Meaning of less/greater than in handle objects
3 次查看(过去 30 天)
显示 更早的评论
What is the meaning of less/greater than in handle objects? Here is a simple example.
classdef SimpleHandle < handle
end
When I create and compare two objects:
a=SimpleHandle();
b=SimpleHandle();
a > b
the result is randomly true or false.
I understand the use of == versus isqual for handle objects, but the notion of greater/less than eludes me.
0 个评论
采纳的回答
Bruno Luong
2020-9-17
I believe the graphic handle object at one point of MATLAB history (before R2014b?) is just a double numbers unique assigned too each object.
They are used to identify the object. Matlab later replace HANDLE with a real object, but keep comparison for compatibility.
Shouldn't worry about comparing them, it's meaningless operation.
2 个评论
Walter Roberson
2020-9-17
You can still double() any handle, and handle() any double (but the result might be an invalid handle.)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!