logical インデックスに、配列​範囲外の真の値が含ま​れています。

タイトルのエラーメッセージに悩んでいます。
エラーを起こす原因もエラーの意味も分かりません。
該当するラインのコマンドは以下の通りです。
wins = sum(result_table.Profit > 0.5);
ロジカル値の総数を求めている訳ですが、ここでエラーが発生します。
また、不思議な現象も発生しています。
変数result_tableを抽出し、コマンドライン上で同じコマンドを実行してもエラーが発生しないのです。
心当たりのある方、ご回答の程よろしくお願いいたします。

 채택된 답변

Ameer Hamza
Ameer Hamza 2020년 11월 13일

0 개 추천

It seems that there exists a variable named 'sum' in your workspace. Are you using a variable named 'sum' in your code? If yes, change its name to something else.

댓글 수: 2

Takao
Takao 2020년 11월 13일
Thank you for your reply!!
I really appreciate it!!
My answer is 'yes'.
I was using 'sum' in the lines. I was not aware of my mistake.
Are you a wizard?
I am really suprised that you made a suitable answer to my Japanese question.
Ameer Hamza
Ameer Hamza 2020년 11월 13일
I am glad to be of help! :)
I used google translate, and this is a very common error for beginners. That is why I was able to spot it easily. :D

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 プログラミング에 대해 자세히 알아보기

질문:

2020년 11월 13일

댓글:

2020년 11월 13일

Community Treasure Hunt

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

Start Hunting!