I’m wondering if there is an easy way to check if two Matlab objects are equal. I got
A = Section(1, Point(0, 0), Point(0, 0));
B = Section(1, Point(0, 0), Point(0, 0));
if(A == B) % I know this is incorrect, but how could I fix it up?
fprintf('Equal\n');
else
fprintf('Not Equal\n');
end
After instantiating two sections, I want to check if they are the same (in the case above they are equal). How could I do that?
isequal
is probably what you want, but this page has further information on comparing and sorting handle objects. eq
(==
) tests if two objects have the same handle, i.e., handle equality, whereas isequal
tests if two objects have equal property values.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With