フィルターのクリア

Subscript indices must either be real positive integers or logicals.

1 回表示 (過去 30 日間)
hdiba
hdiba 2016 年 5 月 4 日
編集済み: Guillaume 2016 年 5 月 4 日
Hi, I want to make the sum in a 20x12 matrix,that consists of doubles. Some entries are zero and some not. I get the following error: Subscript indices must either be real positive integers or logicals.
can someone help?

回答 (1 件)

Guillaume
Guillaume 2016 年 5 月 4 日
編集済み: Guillaume 2016 年 5 月 4 日
It would help if you posted the code that causes the error. From the little information you've given (you want to sum), it's impossible to know what the problem is as summing does not involve indexing.
Unless you've committed the cardinal sin of creating a variable called sum and are then trying to call the sum function. In this case, you are not calling sum but instead indexing into your sum variable. The fix is simple, do not use sum as a variable name and
clear sum
to get rid of the offending variable.

カテゴリ

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