- 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.
Error: horzcat CAT arguments dimensions are not consistent. with feedforwardnet and newff
1 view (last 30 days)
Show older comments
JAGRITI SAINI
on 9 Apr 2017
Commented: Walter Roberson
on 19 Apr 2017
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 Comment
per isakson
on 9 Apr 2017
Edited: per isakson
on 9 Apr 2017
Accepted Answer
Walter Roberson
on 9 Apr 2017
feedforwardnet requires the Neutral Network toolbox from R2010b or later.
3 Comments
More Answers (1)
Greg Heath
on 9 Apr 2017
lowercase a, b and c used in repmat are undefined.
Hope this helps.
Thank you for formally accepting my answer
Greg
2 Comments
Greg Heath
on 19 Apr 2017
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
See Also
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!