Subscript indices must either be real positive integers or logicals.
1 view (last 30 days)
Show older comments
BT = (K2) ./ (log((K1 ./ L+ 1)));
y = int16(11.289);
P = (1.438*10.^-2);
Problem comes from this
LST = (BT)./(1 + y(BT))./(P)*(log(Ei));
2 Comments
Accepted Answer
Joshua
on 27 Mar 2017
I am not really sure what BT is, but depending on your values of K1, K2, and L, it probably won't be an integer. For example, with K1=1, K2=1, and L=1, BT=1.4427. y(BT) tries to access the 1.4427th index of y which does not exist. You need to change your code so BT is always an integer.
Or maybe you want y*BT instead for multiplication?
More Answers (1)
Image Analyst
on 27 Mar 2017
This is a FAQ, so see the FAQ document at http://matlab.wikia.com/wiki/FAQ#How_do_I_fix_the_error_.22Subscript_indices_must_either_be_real_positive_integers_or_logicals..22.3F
0 Comments
See Also
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!