MATLAB: Datatype not supported by stateflow data: Data overflow

chardatasimulinkstandalonestateflow

In Stateflow flow graph. I have mentioned a statement
Difference = data1 – data2;
I have assumed data types for this variable as follows
Difference – int32 – local
data1 – int32 – local
data2 -int32 – local
During run time data1 takes 86458 and data2 takes 5381838. while debugging it shows me a error: data overflow…
Kindly Please anyone help me out in solving this issue
Thanks in advance…:)

Best Answer

>> data1=int32(86458 )
data1 =
86458
>> data2=int32(5381838)
data2 =
5381838
>> Difference = data1 - data2
Difference =
-5295380
It seems no problem in Matlab. Are you sure the error is caused by this? Could you step through Stateflow to see when the error occured?
Related Question