Info

This question is closed. Reopen it to edit or answer.

index matrix error

1 view (last 30 days)
sayed hossain
sayed hossain on 26 May 2012
Closed: MATLAB Answer Bot on 20 Aug 2021
% Solve an Input-Output Fitting problem with a Neural Network
load input.txt;
load output.txt;
hiddenlayersize=10;
net=feedforwardnet(hiddenlayersize);
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
[net,tr]=train(net,input,output);
P=input('p=');
result=sim(net,p);
show this message
result=sim(net,p);
??? Index exceeds matrix dimensions.
Error in ==> samplepro at 10
P=input('p=');

Answers (1)

Image Analyst
Image Analyst on 26 May 2012
You ask for p but store it in P. MATLAB is case sensitive, so in your next line, p is still not defined yet. You just define upper case P not lower case p.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!