Info
此问题已关闭。 请重新打开它进行编辑或回答。
Please I need help, i am running a code but i am receiving an error message: Attempted to access Px(1.18059); index must be positive integer or logical
1 次查看(过去 30 天)
显示 更早的评论
Please I need help, i am running a code but i am receiving an error message: Attempted to access Px(1.18059); index must be positive integer or logical
1 个评论
B.k Sumedha
2015-6-3
Post that part of the code.So that the error be identified in a more easier way.
回答(2 个)
B.k Sumedha
2015-6-3
编辑:B.k Sumedha
2015-6-3
Its a floating point error down at the 5th significant figure. If you simply round "Px", it'll MAY work
6 个评论
Walter Roberson
2015-6-4
Px(var_ab _ var_ae) is not valid syntax. Possibly you meant
Px(var_ab - var_ae)
If so then you would be attempting to subtract the two variables and use the result to index the array "Px".
Possibly you intended multiplication,
Rx = log2((1 + Px*(var_ab - var_ae)+(1 +var_ae*Pw +Pb*var_be.^2+ 2*sqrt(Pb*Px*var_ab*var_ae))));
Image Analyst
2015-6-4
I think the FAQ explains the general cause of this error pretty well: 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 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!