what the fault in my code
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Mohammed Alabiech
el 27 de Ag. de 2017
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 comentarios
Respuesta aceptada
John D'Errico
el 28 de Ag. de 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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Numeric Types en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!