Matrix dimensions must agree.x1=data(:,2);x2=data(:,3);x3=data(:,4);x4=data(:,5);x5=data(:,6);x6=data(:,7);x7=data(:,8);x8=data(:,9);x9=data(:,10);y=data(:,11);input_train=[x1,x2,x3,x4,x5,x6,x7,x8,x9];output_train=[y];minp=min(input_train);maxp=max(i
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/28 00:14:24
Matrix dimensions must agree.x1=data(:,2);x2=data(:,3);x3=data(:,4);x4=data(:,5);x5=data(:,6);x6=data(:,7);x7=data(:,8);x8=data(:,9);x9=data(:,10);y=data(:,11);input_train=[x1,x2,x3,x4,x5,x6,x7,x8,x9];output_train=[y];minp=min(input_train);maxp=max(i
Matrix dimensions must agree.
x1=data(:,2);
x2=data(:,3);
x3=data(:,4);
x4=data(:,5);
x5=data(:,6);
x6=data(:,7);
x7=data(:,8);
x8=data(:,9);
x9=data(:,10);
y=data(:,11);
input_train=[x1,x2,x3,x4,x5,x6,x7,x8,x9];
output_train=[y];
minp=min(input_train);
maxp=max(input_train);
mint=min(output_train);
maxt=max(output_train);
pn=2*(input_train-minp)/(maxp-minp)-1;
tn=2*(output_train-mint)/(maxt-mint)-1;
结果报错
Error using ==> minus
Matrix dimensions must agree.
Error in ==> rbf1 at 17
pn=2*(input_train-minp)/(maxp-minp);
我觉得矩阵的维度是一致的呀.可以相减
Matrix dimensions must agree.x1=data(:,2);x2=data(:,3);x3=data(:,4);x4=data(:,5);x5=data(:,6);x6=data(:,7);x7=data(:,8);x8=data(:,9);x9=data(:,10);y=data(:,11);input_train=[x1,x2,x3,x4,x5,x6,x7,x8,x9];output_train=[y];minp=min(input_train);maxp=max(i
Matrix dimensions must agree.是说矩阵维度不匹配.
如果你的minp,maxp 都是一个数的话,那就是pcs这个参数的维度有问题.你把pcs从工作空间里调出来,即用鼠标双击workspace 里的pcs,看它里面是否有NAN?
我也遇到过这种情况.一旦有NAN,就会出这种提示.
解决办法是把有NAN的那一行或列删去.删除矩阵的行或者列,你会吧?
比如删除矩阵M的最后一列:M=M(:,1:end-1)
删除两列就把最后一个1改成2.删除行的方法类似,把括号内的指标换一下就行了.