Can MATLAB be changed to single precision "mode"

2 visualizaciones (últimos 30 días)
David Goldsmith
David Goldsmith el 22 de Nov. de 2011
Hi! I'm reimplementing a compiled FORTRAN code package in MATLAB, and I just discovered that the "original" is doing everything in single precision. Producing results that are "as identical as they can be" to those produced by the basis package has a higher premium than the extra precision provided by MATLAB's default of doing everything in double, so I'm faced with having much of my code wrapped with single() functions, unless there's a way to put MATLAB into single precision "mode" I wasn't able to find searching the help for "single." Thanks!

Respuesta aceptada

Walter Roberson
Walter Roberson el 22 de Nov. de 2011
There is no such mode.
The closest you get is something supported only on some versions under MS Windows. See this thread for hints -- and be sure to notice the strange results that can occur.
See also, though, <http://www.mathworks.com/support/solutions/en/data/1-79FEJH/index.html?product=ML&solution=1-79FEJH> which implies you cannot control the precision of some operations.
  1 comentario
David Goldsmith
David Goldsmith el 22 de Nov. de 2011
Thanks, Walter. I kind of assumed I wouldn't be able to alter the precision of the operations, I was more hoping for simply automatic rounding of all operation results to single precision. I noted at the end of "this thread" a reference to a "multiple precision toolbox in the FEX"--I'll give that a look-see. Thanks again.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Logical 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!

Translated by