⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dummydn.m

📁 This is matlab sourcecode for measuring gaussian
💻 M
字号:
function y=dummydn(x,v,p)
% DUMMYDN
% DUMMYDN(x,v,p) creates a matrix of dummy variables corresponding to the elements of v
% x: Nx1 vector of data to be broken into dummies.
% The pth vector of dummies is deleted so that the dummy matrix is not colinear with a vector of ones.
% v: Kx1 vector specifying the k-1 breakpoints (in ascending order) that
% define the k categories used to construct the dummy variables.
% y: NxK output matrix containing the k dummy variables.
y=[];
[i j]=size(x);
if j~=1
   error('x must be a vector')
   else
nv=[-Inf; v; +Inf];
for i=2:rows(nv);
   t=x<=nv(i) & x>nv(i-1);
   y=[y t];
end
y(:,p)=NaN;
y=(packr(y'))';
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -