Let say I have a class Foo
classdef Foo function obj = Foo(x,y) % constructor's body
endend
If I want to preallocate spaces for a matrix of Foo objects
>> foos = Foo(3,4);
How is it different from creating one object with arguments x = 3, y = 4?
>> foo = Foo(3,4);
Note that if I avoid preallocation, Matlab will give me some warning due to speed optimization.
Thanks,
Best Answer