Why do I get a "units are not commensurate" error when adding or subtracting the units 'C' and 'K'?
31 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 22 de Jul. de 2016
Editada: MathWorks Support Team
el 8 de Oct. de 2022
I am trying to subtract two temperatures in Simscape. One temperature is in Celsius, and the other is in Kelvin. Why do I get a "units are not commensurate" error when adding or subtracting the units 'C' and 'K'?
Respuesta aceptada
MathWorks Support Team
el 8 de Oct. de 2022
Editada: MathWorks Support Team
el 8 de Oct. de 2022
For Simscape to be able to subtract two units, the units have to be able to be converted into similar units. For example, you can subtract Celsius from Kelvin because they are both temperatures, and you can convert Celsius into Kelvin (or Kelvin into Celsius).
In Simscape, 'C' represents Coulomb. Because the two units Coulomb and Kelvin cannot be converted into the same unit (they're not both temperatures), Simscape throws the error. Instead, represent Celsius with the unit 'degC'. The list of unit definitions for Simscape can be found at the following link:
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Physical Units 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!