Robochameleon  v1.0
findUnit.m
Go to the documentation of this file.
1 
2 function obj = findUnit(module, label)
3 
4 if ~isa(module,'module')
5  error('First input must be of class module.');
6 end
7 
8 obj = [];
9 L = length(label);
10 for i=1:numel(module.internalUnits)
11  o = module.internalUnits{i};
12  if strcmp(label,o.label(1:min(L,end)))
13  obj = o;
14  return;
15  elseif isa(o,'module')
16  obj = findUnit(o, label);
17  if ~isempty(obj), return; end
18  end
19 end
function findUnit(in module, in label)
Finds a unit within a module.
Superclass: collection/sequence of unit.
Definition: module.m:64