how to solve this problem? with message subscript indices must either be real positive integers?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
rico aditia prahmana
am 6 Mär. 2015
Kommentiert: Star Strider
am 6 Mär. 2015
Hello, I get this error, Subscript indices must either be real positive integers or logicals.
The line with this error is,
An=110;
Am=100;
DUM(100,An/(Am+1)+1)={''};
0 Kommentare
Akzeptierte Antwort
Star Strider
am 6 Mär. 2015
The index you’re calculating evaluates to 2.0891... so as a float, it definitely does not meet the integer-or-logical criterion.
I’m not certain what you’re doing with your indices, but one option would be to use the fix function to produce an integer index:
DUM(100,fix(An/(Am+1))+1)={''};
Other options, if fix does not produce the result you want, are of course are ceil, floor, and round.
2 Kommentare
Weitere Antworten (0)
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!