フィルターのクリア

Subscript indices must either be real positive integers or logicals.

2 ビュー (過去 30 日間)
KAPIL MAMTANI
KAPIL MAMTANI 2015 年 10 月 30 日
コメント済み: KAPIL MAMTANI 2015 年 10 月 31 日
I am getting this error in my code, went thru different explanations but everything went-above my head.Can anyone me guide in right direction.Thanks in advance.
  2 件のコメント
KAPIL MAMTANI
KAPIL MAMTANI 2015 年 10 月 30 日
Thank you very much Mr John D`Errico. I missed this.
John D'Errico
John D'Errico 2015 年 10 月 31 日
Until I stepped through your code, I did not notice it either, although, in hindsight it is obvious. The important thing is to use that idea, to step through code to see what is happening, and what went wrong.

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

採用された回答

John D'Errico
John D'Errico 2015 年 10 月 30 日
編集済み: John D'Errico 2015 年 10 月 30 日
Learn to execute your code ONE line at a time when you have a problem like this. Or learn to use the debugger. Then, READ THE ERROR MESSAGE.
I'll get you started. Here is where the problem occurs.
Gp = ((Kt*(1.015^(T-20)))*(P(i)/(P2+P(i)))*(TIC(i)/(C2+TIC(i)))*(N(i)/N2+N(i)))
Subscript indices must either be real positive integers or logicals.
Now, all you need to do is think about what that error means.
At that point, is i defined?
i
ans =
0 + 1i
Learning to debug your code is one of the most important skills in MATLAB. Time to start.

その他の回答 (1 件)

Image Analyst
Image Analyst 2015 年 10 月 31 日

カテゴリ

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