how to convert this statement into matlab

2 visualizaciones (últimos 30 días)
Sowmya Bethi
Sowmya Bethi el 16 de Sept. de 2020
Comentada: Ameer Hamza el 17 de Sept. de 2020
BOOL_TO_REAL(NOT(PRM_EMS.PRG[p].ignorePwrAux))*EMS.PRG[p].PrcPwrAuxTotal;

Respuesta aceptada

Ameer Hamza
Ameer Hamza el 16 de Sept. de 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.
  2 comentarios
Sowmya Bethi
Sowmya Bethi el 17 de Sept. de 2020
thank you so much for the answer
Ameer Hamza
Ameer Hamza el 17 de Sept. de 2020
I am glad to be of help!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Simulink PLC Coder en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by