assign class object to array
古いコメントを表示
Assume the following class
classdef A < handle
methods
function obj = A
disp('constructor called')
end
end
end
Now create an array of 10 instances of A
>> a(10) = A
constructor called
constructor called
Why is the constructor called twice? Why not 10x or 1x?
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Construct and Work with Object Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!