MATLAB Answers

0

Is there a difference between declaring a class property "Dependent" versus "Dependent = true"?

Asked by Austin Spencer on 12 Jul 2019
Latest activity Edited by Matt J
on 12 Jul 2019
The title says it all. The documentation doesn't make it clear whether or not there is a difference between
properties(Dependent)
aProp
end
and
properties(Dependent=true)
aProp
end
since it uses both seemingly interchangeably. Is there a difference?

  0 Comments

Sign in to comment.

Products


Release

R2018b

2 Answers

Answer by Matt J
on 12 Jul 2019
Edited by Matt J
on 12 Jul 2019
 Accepted Answer

Yes, they are equivalent. Also, you can do,
properties(~Dependent)
aProp
end
as an equivalent to,
properties(Dependent=false)
aProp
end
See also,

  0 Comments

Sign in to comment.


Answer by Brendan Hamm on 12 Jul 2019

There is no difference. For attributes which are binary (true/false) then just putting the attribute name is the same as toggling it from its default state.

  0 Comments

Sign in to comment.