I believe this isn't possible. I think you have to use a cell array of the objects as a work around.
See this answer: Limitation on arrays of objects with matlab coder
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!