matlab RBF神经网络程序运行出错的问题!!!
有一个RBF的神经网络程序,运行后出现以下错误,??? Error using ==> newrb
Inputs and Targets have different numbers of columns.
Error in ==> rbf3 at 143
net=newrb(X,T,err_goal,sc,10000,1);
好像是p和t的列数要相等,但小弟不知道怎么修改,谁知道怎样修改呀!! 多谢了.
以下是程序源码
m_data=[0.000000-96.688193-103.619665-96.6881930.0000000.000000;
-50.636491-94.580983-102.621462-96.7876970.1000000.000000;
-64.499435-92.225322-101.635156-97.0804000.2000000.000000;
-72.608737-89.554694-100.675954-97.5499700.3000000.000000;
-78.362379-86.471681-99.763040-98.1723930.4000000.000000;
-82.825250-82.825250-98.919629-98.9196290.5000000.000000;
-86.471681-78.362379-98.172393-99.7630400.6000000.000000;
-89.554694-72.608737-97.549970-100.6759540.7000000.000000;
-92.225322-64.499435-97.080400-101.6351560.8000000.000000;
-94.580983-50.636491-96.787697-102.6214620.9000000.000000;
-96.6881930.000000-96.688193-103.6196651.0000000.000000;
-50.636491-96.787697-102.621462-94.5809830.0000000.100000;
-57.567963-94.703684-101.512455-94.7036840.1000000.100000;
-66.730870-92.380364-100.403829-95.0630040.2000000.100000;
-73.662342-89.756721-99.311836-95.6345880.3000000.100000;
-78.968625-86.745670-98.258231-96.3836010.4000000.100000;
-83.217457-83.217457-97.270882-97.2708820.5000000.100000;
-86.745670-78.968625-96.383601-98.2582310.6000000.100000;
-89.756721-73.662342-95.634588-99.3118360.7000000.100000;
-92.380364-66.730870-95.063004-100.4038290.8000000.100000;
-94.703684-57.567963-94.703684-101.5124550.9000000.100000;
-96.787697-50.636491-94.580983-102.6214621.0000000.100000;
-64.499435-97.080400-101.635156-92.2253220.0000000.200000;
-66.730870-95.063004-100.403829-92.3803640.1000000.200000;
-71.430907-92.831568-99.156794-92.8315680.2000000.200000;
-76.285985-90.339410-97.910370-93.5410860.3000000.200000;
-80.593814-87.525286-96.688193-94.4567580.4000000.200000;
-84.309450-84.309450-95.522855-95.5228550.5000000.200000;
-87.525286-80.593814-94.456758-96.6881930.6000000.200000;
-90.339410-76.285985-93.541086-97.9103700.7000000.200000;
-92.831568-71.430907-92.831568-99.1567940.8000000.200000;
-95.063004-66.730870-92.380364-100.4038290.9000000.200000;
-97.080400-64.499435-92.225322-101.6351561.0000000.200000;
-72.608737-97.549970-100.675954-89.5546940.0000000.300000;
-73.662342-95.634588-99.311836-89.7567210.1000000.300000;
-76.285985-93.541086-97.910370-90.3394100.2000000.300000;
-79.540209-91.240921-96.486166-91.2409210.3000000.300000;
-82.825250-88.703116-95.063004-92.3803640.4000000.300000;
-85.900097-85.900097-93.677142-93.6771420.5000000.300000;
-88.703116-82.825250-92.380364-95.0630040.6000000.300000;
-91.240921-79.540209-91.240921-96.4861660.7000000.300000;
-93.541086-76.285985-90.339410-97.9103700.8000000.300000;
-95.634588-73.662342-89.756721-99.3118360.9000000.300000;
-97.549970-72.608737-89.554694-100.6759541.0000000.300000;
-78.362379-98.172393-99.763040-86.4716810.0000000.400000;
-78.968625-96.383601-98.258231-86.7456700.1000000.400000;
-80.593814-94.456758-96.688193-87.5252860.2000000.400000;
-82.825250-92.380364-95.063004-88.7031160.3000000.400000;
-85.293850-90.148929-93.403153-90.1489290.4000000.400000;
-87.772212-87.772212-91.745230-91.7452300.5000000.400000;
-90.148929-85.293850-90.148929-93.4031530.6000000.400000;
-92.380364-82.825250-88.703116-95.0630040.7000000.400000;
-94.456758-80.593814-87.525286-96.6881930.8000000.400000;
-96.383601-78.968625-86.745670-98.2582310.9000000.400000;
-98.172393-78.362379-86.471681-99.7630401.0000000.400000;
-82.825250-98.919629-98.919629-82.8252500.0000000.500000;
-83.217457-97.270882-97.270882-83.2174570.1000000.500000;
-84.309450-95.522855-95.522855-84.3094500.2000000.500000;
-85.900097-93.677142-93.677142-85.9000970.3000000.500000;
-87.772212-91.745230-91.745230-87.7722120.4000000.500000;
-89.756721-89.756721-89.756721-89.7567210.5000000.500000;
-91.745230-87.772212-87.772212-91.7452300.6000000.500000;
-93.677142-85.900097-85.900097-93.6771420.7000000.500000;
-95.522855-84.309450-84.309450-95.5228550.8000000.500000;
-97.270882-83.217457-83.217457-97.2708820.9000000.500000;
-98.919629-82.825250-82.825250-98.9196291.0000000.500000;
-86.471681-99.763040-98.172393-78.3623790.0000000.600000;
-86.745670-98.258231-96.383601-78.9686250.1000000.600000;
-87.525286-96.688193-94.456758-80.5938140.2000000.600000;
-88.703116-95.063004-92.380364-82.8252500.3000000.600000;
-90.148929-93.403153-90.148929-85.2938500.4000000.600000;
-91.745230-91.745230-87.772212-87.7722120.5000000.600000;
-93.403153-90.148929-85.293850-90.1489290.6000000.600000;
-95.063004-88.703116-82.825250-92.3803640.7000000.600000;
-96.688193-87.525286-80.593814-94.4567580.8000000.600000;
-98.258231-86.745670-78.968625-96.3836010.9000000.600000;
-99.763040-86.471681-78.362379-98.1723931.0000000.600000;
-89.554694-100.675954-97.549970-72.6087370.0000000.700000;
-89.756721-99.311836-95.634588-73.6623420.1000000.700000;
-90.339410-97.910370-93.541086-76.2859850.2000000.700000;
-91.240921-96.486166-91.240921-79.5402090.3000000.700000;
-92.380364-95.063004-88.703116-82.8252500.4000000.700000;
-93.677142-93.677142-85.900097-85.9000970.5000000.700000;
-95.063004-92.380364-82.825250-88.7031160.6000000.700000;
-96.486166-91.240921-79.540209-91.2409210.7000000.700000;
-97.910370-90.339410-76.285985-93.5410860.8000000.700000;
-99.311836-89.756721-73.662342-95.6345880.9000000.700000;
-100.675954-89.554694-72.608737-97.5499701.0000000.700000;
-92.225322-101.635156-97.080400-64.4994350.0000000.800000;
-92.380364-100.403829-95.063004-66.7308700.1000000.800000;
-92.831568-99.156794-92.831568-71.4309070.2000000.800000;
-93.541086-97.910370-90.339410-76.2859850.3000000.800000;
-94.456758-96.688193-87.525286-80.5938140.4000000.800000;
-95.522855-95.522855-84.309450-84.3094500.5000000.800000;
-96.688193-94.456758-80.593814-87.5252860.6000000.800000;
-97.910370-93.541086-76.285985-90.3394100.7000000.800000;
-99.156794-92.831568-71.430907-92.8315680.8000000.800000;
-100.403829-92.380364-66.730870-95.0630040.9000000.800000;
-101.635156-92.225322-64.499435-97.0804001.0000000.800000;
-94.580983-102.621462-96.787697-50.6364910.0000000.900000;
-94.703684-101.512455-94.703684-57.5679630.1000000.900000;
-95.063004-100.403829-92.380364-66.7308700.2000000.900000;
-95.634588-99.311836-89.756721-73.6623420.3000000.900000;
-96.383601-98.258231-86.745670-78.9686250.4000000.900000;
-97.270882-97.270882-83.217457-83.2174570.5000000.900000;
-98.258231-96.383601-78.968625-86.7456700.6000000.900000;
-99.311836-95.634588-73.662342-89.7567210.7000000.900000;
-100.403829-95.063004-66.730870-92.3803640.8000000.900000;
-101.512455-94.703684-57.567963-94.7036840.9000000.900000;
-102.621462-94.580983-50.636491-96.7876971.0000000.900000;
-96.688193-103.619665-96.6881930.0000000.0000001.000000;
-96.787697-102.621462-94.580983-50.6364910.1000001.000000;
-97.080400-101.635156-92.225322-64.4994350.2000001.000000;
-97.549970-100.675954-89.554694-72.6087370.3000001.000000;
-98.172393-99.763040-86.471681-78.3623790.4000001.000000;
-98.919629-98.919629-82.825250-82.8252500.5000001.000000;
-99.763040-98.172393-78.362379-86.4716810.6000001.000000;
-100.675954-97.549970-72.608737-89.5546940.7000001.000000;
-101.635156-97.080400-64.499435-92.2253220.8000001.000000;
-102.621462-96.787697-50.636491-94.5809830.9000001.000000;
-103.619665-96.6881930.000000-96.6881931.0000001.000000]; X=m_data(:,1:4);T=m_data(:,5:6);
T=T';
%随机选取中心
C=X;
%定义delta平方为样本各点的协方差之和
delta=cov(X');
delta=sum(delta);
%隐含层输出H
for i=1:1:121
for j=1:1:121
H(i,j)=((X(i,:)-C(j,:)))*((X(i,:)-C(j,:))');
H(i,j)=exp(-H(i,j)./delta(j));
end
end
p=H;
%建模
%
err_goal=0.001;
sc=3;
net=newrb(X,T,err_goal,sc);
Y=sim(net,p);
E=T-Y;
SSE=sse(E);
MSE=mse(E);
%拟合图
figure;
for i=1:1:121
plot(T(i,1),T(i,2),'*');
end
hold on;
plot(Y,'r:');
title('RBF网络拟合曲线图');
legend('化验值','估计值');
ylabel('利用率');
xlabel('输入样本点');
axis();
页:
[1]