how to use a class with special characters in class name?

8 views (last 30 days)
I am trying to use Matlab to control a linear stage from Thorlabs. The old codes (Driver for Thorlabs motorized stages - File Exchange - MATLAB Central (mathworks.com)) no longer work, then I played a bit and found the cause being a value in an enumerate structure (in c++) was not accessible, though Matlab knows correctly that the value belongs to an enumerate class. Interestingly, it was because there was a plus sign "+" in the class name, returned by Matlab (in the real .dll, I don't know if the original class named in that way). So, is there a way to get access to a member of such kind of classes that have a special character in their names?
The following is some output during the debug process.
K>> class(h.currentDeviceSettingsNET.Rotation.RotationDirection)
ans =
'Thorlabs.MotionControl.GenericMotorCLI.Settings.RotationSettings+RotationDirections'
K>> enumeration Thorlabs.MotionControl.GenericMotorCLI.Settings.RotationSettings+RotationDirections
Enumeration members for class 'Thorlabs.MotionControl.GenericMotorCLI.Settings.RotationSettings+RotationDirections':
Quickest
Forwards
Reverse
K>> Thorlabs.MotionControl.GenericMotorCLI.Settings.RotationSettings+RotationDirections.Forwards
Unable to resolve the name 'RotationDirections.Forwards'.

Answers (1)

Walter Roberson
Walter Roberson on 11 Apr 2023
Moved: Walter Roberson on 12 Apr 2023
You could try
Thorlabs.MotionControl.GenericMotorCLI.Settings.('RotationSettings+RotationDirections').Forwards
It might work, depending on the internal implementation.

Tags

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!