フィルターのクリア

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 日間)
olawoyin abiodun
olawoyin abiodun 2015 年 6 月 3 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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
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
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 件のコメント
olawoyin abiodun
olawoyin abiodun 2015 年 6 月 4 日
編集済み: Walter Roberson 2015 年 6 月 4 日
Thanks for your quick response and assistance, the code is below Sumedha, Guillaume. Thanks, the code is as follows
Rx = log2((1 + Px(var_ab _ var_ae)+(1 +var_ae*Pw +Pb*var_be.^2+ 2*sqrt(Pb*Px*var_ab*var_ae))));
Thanks
Walter Roberson
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
Image Analyst 2015 年 6 月 4 日

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by