mk_data.m
来自「基于MATLAB完成的神经网络源程序,可以利用该程序完成有关神经网络的应用。」· M 代码 · 共 43 行
M
43 行
function C=mk_data(pats)% function C=mk_data(pats)%% makes the data used in the backprop, RBF, SVM experiment% % pats - number of pattern vectors to create - must be even as% the two classes are equiprobable%% column 1 - x coordinate% column 2 - y coordinate% column 3 - target 1% column 4 - target 2% column 5 - class%% Hugh Pasika 1997if floor(pats/2)*2 ~= pats, disp('Number of patterns should be equal - try again!'); breakendf=pats/2;C1=randn(f,2);C1(:,3)=ones(f,1)*.95;C1(:,4)=ones(f,1)*.05;C1(:,5)=zeros(f,1);C2=randn(f,2);C2=C2*2;C2(:,1)=C2(:,1)+2;C2(:,3)=ones(f,1)*.05;C2(:,4)=ones(f,1)*.95;C2(:,5)=ones(f,1)*1;% shuffle them upH=[C1' C2']';[y i]=sort(rand(f*2,1));C=H(i,:);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?