MATLAB: What is the difference between “<>“, “!=” and “~=” in a Stateflow chart

!=~=cchart;stateflow

I have a Stateflow chart where the symbol "<>" is used. I tried to replace this symbol with "!=" but it seems to give identical results. What is the risk of change in behavior of the model or of the generated code if all "<>" are placed with "!=" ?

Best Answer

The "<>" symbol is indeed equivalent to "!=". Nevertheless, it would be more robust to replace both of these expressions with "~=".
This is because, both "<>" and "!=" are binary operations which are only supported when using C as the action language of the chart:
On the other hand, "~=" is supported both when using MATLAB or C as the action language.
For more information about using MATLAB or C as an action language see: