开发者

basic matlab help

开发者 https://www.devze.com 2022-12-13 19:34 出处:网络
matlab is acting weird. if I assign the value 202 to variable a and 207 to variable b then add a+b it gives me the correct answer 409. Now if I subtract a-b it gives me 0 instead of -5.

matlab is acting weird. if I assign the value 202 to variable a and 207 to variable b then add a+b it gives me the correct answer 409. Now if I subtract a-b it gives me 0 instead of -5. btu if I do 202-207(not using the variables a and b ) it gives me -5.

what could be causing this?

edit: it gets even weird. I just noticed that matlab gives me a-b=0 only when I assign it the values 202 and 207 from a data matrix a=data(1,1),b=data(2,1). if I assign the values directly to a and b it a开发者_如何学Ccts normal


a = uint8(202);
b = uint8(207);

>> a-b
ans =
    0

>> 202-207
ans =
    -5
0

精彩评论

暂无评论...
验证码 换一张
取 消