nndef.m
来自「模式识别工具箱,本人毕业论文时用到的,希望对大家有用!」· M 代码 · 共 24 行
M
24 行
function y=nndef(x,d)%NNDEF Replace missing and NaN values with defaults.% % *WARNING*: This function is undocumented as it may be altered% at any time in the future without warning.% NNDEF(X,D)% X - Row vector of proposed values.% D - Row vector of default values.% Returns X with all non-finite and missing values with% the corresponding values in D.%% EXAMPLE: x = [1 2 NaN 4 5];% d = [10 20 30 40 50 60];% y = nndef(x,d)% Mark Beale, 12-15-93% Copyright (c) 1992-94 by the MathWorks, Inc.% $Revision: 1.1 $ $Date: 1994/01/11 16:26:16 $y = d;i = find(finite(x(1:min(length(x),length(y)))));y(i) = x(i);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?