NARX Neural Network Error in Preparets (line 293)

2 ビュー (過去 30 日間)
NOOR
NOOR 2017 年 6 月 18 日
for some reason I keep getting this error "index exceeds matrix dimensions" for my preparets function. Here is my code:
index = 1000;
net = narxnet(1:4,5:8,10);
X = qu2(1:index); T = qd2(1:index);
net.trainParam.min_grad = exp(-10);
[inputs, inputstates, layerstates, targets, EWs, SHIFT] = preparets(net, X, {}, T);
net = train(net,inputs,targets,inputstates,layerstates);
what am I doing wrong?
Thank you in advance!

回答 (1 件)

Greg Heath
Greg Heath 2017 年 6 月 18 日
編集済み: Greg Heath 2017 年 6 月 19 日
> index = 1000;
> X = qu2(1:index);
> T = qd2(1:index);
>
> ERROR: "index exceeds matrix dimensions"
Isn't it obvious ?
To check
sizequ2 = size(qu2)
etc
Hope this helps.
Thank you for formally accepting my answer
Greg
  3 件のコメント
Greg Heath
Greg Heath 2017 年 6 月 22 日
1. Did you insert the equations I posted? What was the result?
2. What do you get when you use the command that lists all of the variables?
Shashank Srivastava
Shashank Srivastava 2018 年 1 月 15 日
This problem gets solved by using command num2cell, as in X = num2cell(qu2(1:index));

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by