Skip to content
Snippets Groups Projects
Commit 5df7d92c authored by marwan's avatar marwan
Browse files

bug on check of data length

parent 19918eb0
No related branches found
No related tags found
No related merge requests found
...@@ -55,6 +55,9 @@ function out=fnn(varargin) ...@@ -55,6 +55,9 @@ function out=fnn(varargin)
% $Revision$ % $Revision$
% %
% $Log$ % $Log$
% Revision 5.6 2010/01/06 08:59:24 marwan
% bugfix if embedding exceeds data length
%
% Revision 5.5 2009/07/21 11:24:26 marwan % Revision 5.5 2009/07/21 11:24:26 marwan
% missing default t % missing default t
% %
...@@ -515,11 +518,11 @@ case 'compute' ...@@ -515,11 +518,11 @@ case 'compute'
% distance in the m-dimensional space % distance in the m-dimensional space
switch method switch method
case 1 case 1
distance = max(abs(x2-repmat(x(jx(idx(i),:))',length(x2),1))'); distance = max(abs(x2-repmat(x(jx(idx(i),:))',size(x2,1),1))');
case 2 case 2
distance = sqrt(sum((x2-repmat(x(jx(idx(i),:))',length(x2),1)).^2,2)); distance = sqrt(sum((x2-repmat(x(jx(idx(i),:))',size(x2,1),1)).^2,2));
case 3 case 3
distance = sum(abs(x2-repmat(x(jx(idx(i),:))',length(x2),1)),2); distance = sum(abs(x2-repmat(x(jx(idx(i),:))',size(x2,1),1)),2);
end end
[distance is] = sort(distance); [distance is] = sort(distance);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment