how to convert this statement into matlab

3 views (last 30 days)
BOOL_TO_REAL(NOT(PRM_EMS.PRG[p].ignorePwrAux))*EMS.PRG[p].PrcPwrAuxTotal;

Accepted Answer

Ameer Hamza
Ameer Hamza on 16 Sep 2020
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.

More Answers (0)

Categories

Find more on Simulink PLC Coder in Help Center and File Exchange

Tags

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!