mirror of
https://github.com/MillironX/beefblup.git
synced 2024-11-14 11:33:10 +00:00
10 lines
212 B
Mathematica
10 lines
212 B
Mathematica
|
% uniquenan
|
||
|
% Serves the same purpose as UNIQUE, but ensures any NaN fields are not
|
||
|
% counted
|
||
|
function y = uniquenan(x)
|
||
|
y = unique(x);
|
||
|
if any(isnan(y))
|
||
|
y(isnan(y)) = [];
|
||
|
y(end + 1) = NaN;
|
||
|
end
|
||
|
end
|