what the fault in my code
1 view (last 30 days)
Show older comments
I have problem with this code
skAx=1966
skAy=4372
p=5449
Pmlx(1)=10
Pmly(1)=2
Cm3(1)=mod(Pmlx(1)+skAx+skAy,p)
Cm4(1)=mod(Pmly(1)+Cm3(j),p)
when I implement, the result below
Cm3 = 255
Cm4 = 255
while the correct result must be
Cm3 = 899
Cm4 = 901
0 Comments
Accepted Answer
John D'Errico
on 28 Aug 2017
Hint: Don't stuff your results into vectors that are defined to be uint8.
The test is simple.
class(Pmlx)
class(Pmly)
class(cm3)
class(cm4)
One or more of those variables is uint8.
More Answers (0)
See Also
Categories
Find more on Numeric Types in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!