Subscript indices must either be real positive integers or logicals.
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentar
Antworten (1)
Guillaume
am 4 Mai 2016
Bearbeitet: Guillaume
am 4 Mai 2016
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.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!