New to matlab and I do not understand given code
Ältere Kommentare anzeigen
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))
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Data Type Conversion finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!