Index in position 1 exceeds array bounds (must not exceed 1).

10 Comments

Your code has
%load('changeTemp');
%load('changeHum');
but uses matrices changeTemp and changeHum; you did not provide the .mat files for those in the .zip so we cannot test.
Side note: please change your series of xlsread to instead use
data = readtable('loadData.xls');
demand = data{:,4};
hour = data{:,2};
daynumber = data{:,17};
The reason for this is that the way you called xlsread() can only be used on MS Windows with Excel installed; the replacement code I show here can be used on any system (from roughly R2013b onwards).
changeTemp and changeHum are the data which are obtained from the tempHum.m file.
the file is in zip fiile. Please verify once
nn passed CreateNN must be a scalar. In your case, it's a (1x4) vector.
I suggest you change tempHum to
data = readtable('loadData.xls', 'sheet', 'ISONE CA');
temp = data{:,13};
hum = data{:,14};
t=readfis('tempFis2');
h=readfis('humFis2');
changeTemp=zeros(8736,1);
changeHum=zeros(8736,1);
for k=1:8736
out1 = evalfis(t, [temp(k) temp(k+24)]);
changeTemp(k,1)=out1;
out2 = evalfis(h, [hum(k) hum(k+24)]);
changeHum(k,1)=out2;
end
This changes xlsread() to readtable() for the same reasons described above (use on systems without Excel).
This also moves the fis input of evalfis() to the first input, as having it as the second input has been recommended against for many releases.
I am trying to run the code from this link https://github.com/rahulagr0048/Load-Forecasting/blob/master/trainGRNN.m It is the same zip file that i have sent it to you
I have (just now) created an Issue report against the GITHUB contribution.
Response could be anywhere between 5 minutes and never.
Can we create another function with the name CreatNN function for trainging the model
Yes. However, CreateNN is responsible for creating the structure of the Neural Network, and if you do not create the correct structure then you will not get useful results.

Sign in to comment.

Answers (0)

Categories

Asked:

on 31 May 2021

Commented:

on 31 May 2021

Community Treasure Hunt

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

Start Hunting!