assign class object to array
Afficher commentaires plus anciens
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?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Construct and Work with Object Arrays dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!