Extracting the second decimal point of a number

4 visualizaciones (últimos 30 días)
joseph Frank
joseph Frank el 3 de Jun. de 2014
Respondida: Roger Stafford el 3 de Jun. de 2014
Hi,
I want to extract the 2nd decimal point without rounding from a vector of numbers. For example:
A=[8.18750];
I want to get number 8. How can I do so in a simple way.?

Respuesta aceptada

Roger Stafford
Roger Stafford el 3 de Jun. de 2014
A=[8.18750];
d = mod(floor(100*A),10);

Más respuestas (0)

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by