MATLAB: How to check the units of measure for signals in SIMULINK

measuresignalsimulinkunits

I would like to assign units to Simulink signals and I would like SIMULINK to diagnose"unit mismatch operation" like to pass signals with different units to a SUM block.

Best Answer

The ability to set a "Units of measure" attribute to signals or block inports is not available in Simulink.
You can exploit Simulink Data Objects to explicitly set units to a signal as follows:
s=Simulink.Signal
You can set the field "DocUnits" of the signal "S" as follows:
s.DocUnits='RPM'
However, Simulink will not check the units of this signal when added to another signal.The DocUnits property is only for documentation.