New to matlab and I do not understand given code
Afficher commentaires plus anciens
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))
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Data Type Conversion dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!