how to convert this statement into matlab

3 ビュー (過去 30 日間)
Sowmya Bethi
Sowmya Bethi 2020 年 9 月 16 日
コメント済み: Ameer Hamza 2020 年 9 月 17 日
BOOL_TO_REAL(NOT(PRM_EMS.PRG[p].ignorePwrAux))*EMS.PRG[p].PrcPwrAuxTotal;

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 9 月 16 日
Assuming all the functions and variables are defined
BOOL_TO_REAL(~(PRM_EMS.PRG(p).ignorePwrAux))*EMS.PRG(p).PrcPwrAuxTotal;
and if by BOOL_TO_REAL, you mean a function that converts the boolean variable to floating-point data type, then there is no need. MATLAB automatically typecast when boolean is multiplied with floating-point numbers.
  2 件のコメント
Sowmya Bethi
Sowmya Bethi 2020 年 9 月 17 日
thank you so much for the answer
Ameer Hamza
Ameer Hamza 2020 年 9 月 17 日
I am glad to be of help!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink PLC Coder についてさらに検索

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by