Skip to content

Commit

Permalink
bug fix: use last occurrence of sphericalRegion in an argument list
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfHielscher committed Oct 24, 2019
1 parent 8f8a8ad commit 80dbafa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion geometry/geometry_tools/extractSphericalRegion.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function sR = extractSphericalRegion(varargin)

% TODO: maybe consider option 'antipodal'
sR = getClass(varargin,'sphericalRegion');
sR = getClass(varargin,'sphericalRegion',[],'last');
sR = sphericalRegion(sR,varargin{:});
4 changes: 2 additions & 2 deletions tools/option_tools/getClass.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
function [out,list] = getClass(list,className,default)
function [out,list] = getClass(list,className,default,varargin)

if nargin == 2, default = [];end

match = find(cellfun(@(x) isa(x,className),list),1);
match = find(cellfun(@(x) isa(x,className),list),1,varargin{:});

if isempty(match)
out = default;
Expand Down

0 comments on commit 80dbafa

Please sign in to comment.