Error: horzcat CAT arguments dimensions are not consistent. with feedforwardnet and newff
이전 댓글 표시
My Code Is:
A = {MinF; MaxF; MeanF; ModeF; MedianF; SDF; EnergyF; KurtosisF; SkewnessF; EntropyF; VarianceF; ZCRF; MeanPowerF; SNRF; CoVF};
X = cell2mat(A);
B = {MinS; MaxS; MeanS; ModeS; MedianS; SDS; EnergyS; KurtosisS; SkewnessS; EntropyS; VarianceS; ZCRS; MeanPowerS; SNRS; CoVS};
Y = cell2mat(B);
C = {MinZ; MaxZ; MeanZ; ModeZ; MedianZ; SDZ; EnergyZ; KurtosisZ; SkewnessZ; EntropyZ; VarianceZ; ZCRZ; MeanPowerZ; SNRZ; CoVZ};
Z = cell2mat(C);
P = [X Y Z];
% define targets
T = [repmat(a,1,length(X)) repmat(b,1,length(Y)) ...
repmat(c,1,length(Z))];
net = feedwordwardnet([P,T,3]);
% train net
net.divideParam.trainRatio = 1; % training set [%]
net.divideParam.valRatio = 0; % validation set [%]
net.divideParam.testRatio = 0; % test set [%]
% train a neural network
[net,tr,Y,E] = train(net,P,T);
% show network
view(net)
It leaves an error message:
??? Error using ==> horzcat CAT arguments dimensions are not consistent.
I replaced feedforwardnet with newff: but same error message appeared.
I also tried solving this problem with:
net = feedforwardnet(3); net = train(net,P,T); view(net)
But it also leads to an error:
??? Undefined function or method 'feedforwardnet' for input arguments of type 'double'.
How should I complete my Training.. please help?
Thanks in Advance
댓글 수: 1
per isakson
2017년 4월 9일
편집: per isakson
2017년 4월 9일
- Do you use the debugging features?
- Set   >> dbstop on error, run your function and inspect the data, which cause the error.
- Click the Help above the edit-box, in which you write your question.
채택된 답변
추가 답변 (1개)
Greg Heath
2017년 4월 9일
0 개 추천
lowercase a, b and c used in repmat are undefined.
Hope this helps.
Thank you for formally accepting my answer
Greg
댓글 수: 2
Greg Heath
2017년 4월 19일
Use the command
dir
to make sure that the dimensions of all variables are really what you think they should be.
Hope this helps.
Greg
Walter Roberson
2017년 4월 19일
dir? That would show a list of files.
카테고리
도움말 센터 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!