how to convert this statement into matlab

1 次查看(过去 30 天)
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink PLC Coder 的更多信息

标签

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by