assign class object to array
Mostra commenti meno recenti
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?
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Construct and Work with Object Arrays in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!