is there a conversion command ?

1 visualización (últimos 30 días)
diadalina
diadalina el 23 de Oct. de 2017
Respondida: Steven Lord el 23 de Oct. de 2017
if we want to convert a fractional number to decimal, is there any command doing this? for example x=1/33 to convert it to 0.0303 ?

Respuestas (1)

Steven Lord
Steven Lord el 23 de Oct. de 2017
Just type that at the prompt in the Command Window or include that command in your script / function / class file.
x = 1/33
If you've already generated x using symbolic operations, use the double or vpa functions on x. I used the variable name y below so you can compare it to x.
y = sym(1)/33
d = double(y)
v = vpa(y)
whos x y d v

Categorías

Más información sobre Numbers and Precision en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by