Typecasting Concept

Status
Not open for further replies.

uranyumx

Advanced Member level 4
Joined
Mar 5, 2011
Messages
102
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,296
Activity points
2,098
Hello,

I am casting 16 bit value to 8 bit values with typecast(uint16(app.X.Value), 'uint8');

While I was printing uint16(app.X.Value), I got 10 which is my input value. Then, after casting with typecast(uint16(app.X.Value), 'uint8');, I got 103 0 values. So, how does the program generate these numbers that I want to address?

Thank you,
 

typecast() is a MATLAB function. Why are you posting in microcontrollers section?

It would be helpful if you tell the full context, preferably post a code example that demonstrates the observed effect.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…