How to preallocate an array of class in MATLAB?

后端 未结 4 1899
时光取名叫无心
时光取名叫无心 2020-11-30 13:29

I have an array of objects in MATLAB and I\'ve called their constructors in a loop:

antsNumber  = 5;
for counter = 1: antsNumber
    ant(counter) = TAnt(sour         


        
4条回答
  •  暖寄归人
    2020-11-30 14:34

    The following link might be of help:

    http://www.mathworks.com/help/techdoc/matlab_oop/brd4btr.html#brd4nrh
    Web archive of dead link

    New link:
    http://de.mathworks.com/help/matlab/matlab_oop/creating-object-arrays.html

提交回复
热议问题