Why do I get the error "Invalid default value for property" when trying to define one default instance variable value in terms of another?
Show older comments
Why do I get the error "Invalid default value for property" when trying to define one default instance variable value in terms of another?
e.g.
classdef Example
properties
A = {'a','b','c'}
B = [A,'d']
end
end
gives me the following error when I try to instantiate an example object
>> Example
Invalid default value for property 'B' in class 'Example':
Undefined function or variable 'A'.
Accepted Answer
More Answers (0)
Categories
Find more on Properties in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!