필터 지우기
필터 지우기

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 CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by