Convert Boolean to integer
34 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
sadat golz
el 22 de Abr. de 2022
Respondida: Walter Roberson
el 22 de Abr. de 2022
Hello,
below is a model of a battery overheating. I used boolean to compare temperatures. However, after comparison, I need to change the boolean value back to its actual integer. For example Cell temp: 23degrees celcius Ambient temp: 40degrees celcius, adding both together gives 63degrees celcius, which is higher than the treshold of 60degrees celcius. Therefore tha battery is overheating. However, I only see the value '1' instead of '63'. I need to convert the boolean value to the integer. I tried using data type convertion, but it still remains boolean. The display outputs the value '1' for active and '0' for not active. But I want the actual numbers instead. Can someone give adivce on how to convert it.
Kind regards
Sadat Golz
0 comentarios
Respuesta aceptada
Walter Roberson
el 22 de Abr. de 2022
Make the temperature an input to the block to be triggered when the test succeeds.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Sources en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!