Matlab: Allow simpler syntax for creating ReactorNets with one reactor
A network with a single reactor can be created with either:
ReactorNet({reactor}), i.e. a single element cell array
or, the new way:
ReactorNet(reactor)
This commit is contained in:
parent
4feb983688
commit
c56bfab0ed
1 changed files with 5 additions and 4 deletions
|
|
@ -9,6 +9,11 @@ else
|
|||
error('wrong number of arguments to ReactorNet constructor');
|
||||
end
|
||||
|
||||
if isa(reactors, 'Reactor')
|
||||
% Allow simpler syntax for creating a network with one reactor
|
||||
reactors = {reactors};
|
||||
end
|
||||
|
||||
x.index = reactornetmethods(0,0);
|
||||
if x.index < 0
|
||||
error(geterr);
|
||||
|
|
@ -20,7 +25,3 @@ nr = length(reactors);
|
|||
for i = 1:nr
|
||||
addReactor(x,reactors{i});
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue