Selecting specific number in place value of hunredth
15 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi! I need help, I've been looking a proper function to use but I don't get any, please help me I can't find a way to solve this. Let say I have a number 365 (and I want it to write a code that only read the most right digit which is 5).
Regards, Nurul
0 comentarios
Respuestas (1)
Prabhan Purwar
el 5 de Mayo de 2021
Hi Nurul,
The individual digits in the number signify one's, ten's, hundred's, and thousand's position which could be obtained by dividing the number with the basis^(power of consideration) and getting remainder value by using mod function.
Kindly have a look at the following example code:
% For Natural numbers
x = 365;
floor(mod(x/1,10)) %unit's place
floor(mod(x/10,10)) %hundred's place
floor(mod(x/100,10)) %thousand's place
Hope it helps!
Thanks
0 comentarios
Ver también
Categorías
Más información sobre Continuous Wavelet Transforms en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!