Why answer of uint8 in .m and mdl are different?

1 次查看(过去 30 天)
I have a value of -1.In .m file if i process uint8(-1) i get answer as 0,but in simulink if i feed a constant with -1 and use data conversion of uint8 i get answer as 255.Why do i get different answers.

采纳的回答

Walter Roberson
Walter Roberson 2015-7-27
Notice that Saturate on Integer Overflow defaults to Off; you want it to be On.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Sources 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by