How to handle the error "The 'A' class definition uses an instance of itself directly or indirectly as the default value for the 'b' property. This is not allowed."?
Show older comments
I got an error:
The 'A' class definition uses an instance of itself directly or indirectly as the default value for the 'b' property. This is not allowed.
Below is my code:
classdef A
properties
b = B;
end
end
classdef B
properties
a = A;
end
end
What is wrong in the code? How should I resolve this error?
Accepted Answer
More Answers (0)
Categories
Find more on Create System Objects 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!