Skip to content

Commit

Permalink
Patched bwlabeln
Browse files Browse the repository at this point in the history
  • Loading branch information
lmendo committed Jun 25, 2021
1 parent 4e1a14d commit 6e8faf5
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 2 deletions.
11 changes: 11 additions & 0 deletions compatibility/bwlabeln_comp.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function varargout = bwlabeln_comp(varargin)
% bwlabeln(1), bwlabeln(8), bwlabeln(true) give an error on TIO. This patches that
if numel(varargin{1})==1 && varargin{1} % patch
varargout{1} = 1;
if nargout>1
varargout{2} = 1;
end
else % normal call to bwlabeln
[varargout{1:nargout}] = builtin('bwlabeln', varargin{:});
end
end
Binary file modified funDef.mat
Binary file not shown.
Binary file modified help.mat
Binary file not shown.
2 changes: 1 addition & 1 deletion matl_compile.m
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
'triu' 'tril' 'randsample' 'nchoosek' 'vpa' 'sum' 'mean' 'prod' 'diff' 'mod' 'repelem' 'dec2bin' 'dec2base' ...
'hypergeom' 'disp' 'str2func' 'logical' 'circshift' 'pdist2' 'strsplit' 'max' 'min' 'strncmp' 'round'...
'datestr' 'regexp' 'regexprep' 'imshow' 'mat2str' 'blkdiag' 'strcat' 'str2num' 'str2double' 'cconv' ...
'gcd' 'lcm' 'fftn' 'mode' 'nnz' 'str2sym' 'factor'};
'gcd' 'lcm' 'fftn' 'mode' 'nnz' 'str2sym' 'factor' 'bwlabeln'};
verNumTh = [4 0 0]; % first version in which a modified function is not needed:
if (verNum(1)<verNumTh(1)) || ((verNum(1)==verNumTh(1)) && (verNum(2)<verNumTh(2))) || ((verNum(1)==verNumTh(1)) && (verNum(2)==verNumTh(2)) && (verNum(3)<verNumTh(3)))
fnames = [fnames {'colon'}];
Expand Down
Binary file modified spec/MATL_spec.pdf
Binary file not shown.
6 changes: 5 additions & 1 deletion spec/MATL_spec.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,11 @@ \subsection{MATL functions}
\item
\matlab+sum([],1)+ gives an empty array of size $1 \times 0$ in MATLAB, but \matlab+0+ in Octave. An analogous difference exists with \matlab+prod+. This has been fixed.
\item
\matlab+sum(sym([]))+ gives \matlab+0+ in MATLAB, but an empty array of size $1 \times 0$ in Octave. An analogous difference exists with \matlab+prod+. This has been fixed.
\matlab+sum(sym([]))+ gives \matlab+0+ in MATLAB, but an empty array of size $1 \times 0$ in Octave. An analogous difference exists with \matlab+prod+. This has been fixed.
\item
\matlab+bwlabeln+ with first input of size $1 \times 1$ different than \matlab+0+ or \matlab+false+ gives an error on some systems.
% TIO, Octave 4.2.2, Linux 5.2.11-100.fc29.x86_64 (Fedora). vi21
This has been fixed.
\end{itemize}


Expand Down

0 comments on commit 6e8faf5

Please sign in to comment.