New to matlab and I do not understand given code
Mostrar comentarios más antiguos
When IC is a seven digit number and I need to add the digits in the odd numbered position which ic variable x and I need to add the digits in the even numbered posititon which is variable y. The answer I was given states that when using the sum() i need to minus 48 from both and I do not understand why.
x = sum((ic(2:2:end)-48))
y = sum((ic(3:2:end)-48))
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Data Type Conversion en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!