File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 8484 end
8585 properties (SetAccess = immutable , GetAccess = private , Transient )
8686 Listener = []
87+ no_parallel_toolbox
8788 end
8889 % ---------------------------- Properties -----------------------------
8990 properties (SetAccess = private , Transient )
134135 obj.N = N ;
135136 obj.Queue = parallel .pool .DataQueue ;
136137 obj.Listener = afterEach(obj .Queue , @(~) localIncrement(obj ));
138+ obj.no_parallel_toolbox = ~license(' test' ,' parallel computing toolbox' );
137139 obj.ui_type = ui ;
138140
139141 switch obj .ui_type
154156 end
155157 % ---------------------------- Counter ----------------------------
156158 function count(obj )
157- if isempty(getCurrentJob ) % Serial processing
158- obj .localIncrement(); % faster
159- else % Parallel processing
160- send(obj .Queue , true );
159+ if obj . no_parallel_toolbox || isempty(getCurrentJob )
160+ obj .localIncrement(); % Serial processing
161+ else
162+ send(obj .Queue , true ); % Parallel processing
161163 end
162164 end
163165 end
You can’t perform that action at this time.
0 commit comments