Borrar filtros
Borrar filtros

Convert System.Decimal from C# .NET to double

21 visualizaciones (últimos 30 días)
Christopher Saltonstall
Christopher Saltonstall el 3 de Ag. de 2023
Comentada: Valeriy el 3 de Oct. de 2023
I am communicating with a Thorlabs DC servo controller via .NET. When I query the motor position it returns the value in system.decimal format. I found some documentation that briefly mentions this format but doesn't explain how to convert it to a usable numerical value.
How can I can I convert this to something usable?
The returned postion variable is attached.

Respuesta aceptada

Christopher Saltonstall
Christopher Saltonstall el 3 de Ag. de 2023
load 'pos.mat'
import System.*
methodsview('System.Decimal')
System.Decimal.ToDouble(pos)
  4 comentarios
Walter Roberson
Walter Roberson el 29 de Sept. de 2023
Notes:
This can only work on Windows
You might need to do the import before the load, so that the class is defined at the time of the load()
Valeriy
Valeriy el 3 de Oct. de 2023
OK, I see it, thank you, it is attached

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Call MATLAB from .NET en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by