📄 gendatsin.m
字号:
%GENREGSIN Generate sinusoidal regression data%% X = GENDATSIN(N,SIGMA)%% INPUT% N Number of objects to generate% SIGMA Standard deviation of the noise%% OUTPUT% X Regression dataset%% DESCRIPTION% Generate an artificial regression dataset [X,Y] with:%% y = sin(4x) + noise. %% where noise is Gaussian distributed with standard deviation sigma.%% X = GENDATSIN(100)% generates 100 x,y pairs with data and default noise (sigma = 0.1).%% x = (0:0.01:1)';% y = genregsin(x,0);% generates the true function along the x-axis, with zero noise.%% SEE ALSO% GENDATR, GENDATSINC% Copyright: D.M.J. Tax, D.M.J.Tax@prtools.org% Faculty EWI, Delft University of Technology% P.O. Box 5031, 2600 GA Delft, The Netherlandsfunction x = gendatsin(nrx,noise)if nargin<2 noise = 0.1;endif (length(nrx)>1) x = nrx; nrx = size(x); x = sin(4*x) + noise*randn(nrx);else x = rand(nrx,1); y = sin(4*x) + noise*randn(nrx,1);endx = gendatr(x,y);return
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -