フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Subscript indices must either be real positive integers or logicals

2 ビュー (過去 30 日間)
Deep Gogoi
Deep Gogoi 2015 年 3 月 16 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I have enclosed my .m file . I can't remove the error at line number 29. The error is
" Subscript indices must either be real positive integers or logicals.
Error in ==> rainfall at 29 inputSeriesVal = X(end-N+1:end);
"

回答 (1 件)

Jan
Jan 2015 年 3 月 16 日
You did not enclose the file. So a little bit guessing is required:
The length of X is shorter than N, such that "end-N+1" gets negative.
Usually the debugger helps to understand, what's going on: Set a breakpoint in the first line and step through your code. Examine the values of the used variables in each step.
  3 件のコメント
Jan
Jan 2015 年 3 月 17 日
This is no .mat file, but an .m file. We cannot run you code due to the missing input files.
My explanation remains unchanged except for the detail, that N=15. So I repeat:
This line fails:
inputSeriesVal = X(end-14:end);
Then X has less than 15 elements. The data are simply too short to run your program.
Deep Gogoi
Deep Gogoi 2015 年 3 月 22 日
I have tried but it didnt work. I have attached the input and target file. Plz help with this input and target files

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by