How can I declare Hexadecimal enum constants in a classdef
classdef xyz
properties(Constant)
WaveformTypes = struct(‘SINE’,0, ‘SQUARE’,1, ‘TRIANGLE’,2, ‘RAMP UP’,3, …
‘RAMP DOWN’,4, ‘DC’,5, ‘PULSE’,6, ‘PWM’,7, ‘ARB’,8, ‘COMPOSITE’,9, ‘CUSTOM LUT’, A);
end
methods(Static)
*functions of xyz implemented with calllib*
end
end
I tried using 0x1, 0x2, etc, but this throws a property syntax error. My first question is, will the ‘A’ here denote a hexadecimal value? If not, how else do I declare?
My second question, is there is a better way to implement this? Please ask if you need any further info. Cheers!classdef xyz
properties(Constant)
WaveformTypes = struct(‘SINE’,0, ‘SQUARE’,1, ‘TRIANGLE’,2, ‘RAMP UP’,3, …
‘RAMP DOWN’,4, ‘DC’,5, ‘PULSE’,6, ‘PWM’,7, ‘ARB’,8, ‘COMPOSITE’,9, ‘CUSTOM LUT’, A);
end
methods(Static)
*functions of xyz implemented with calllib*
end
end
I tried using 0x1, 0x2, etc, but this throws a property syntax error. My first question is, will the ‘A’ here denote a hexadecimal value? If not, how else do I declare?
My second question, is there is a better way to implement this? Please ask if you need any further info. Cheers! classdef xyz
properties(Constant)
WaveformTypes = struct(‘SINE’,0, ‘SQUARE’,1, ‘TRIANGLE’,2, ‘RAMP UP’,3, …
‘RAMP DOWN’,4, ‘DC’,5, ‘PULSE’,6, ‘PWM’,7, ‘ARB’,8, ‘COMPOSITE’,9, ‘CUSTOM LUT’, A);
end
methods(Static)
*functions of xyz implemented with calllib*
end
end
I tried using 0x1, 0x2, etc, but this throws a property syntax error. My first question is, will the ‘A’ here denote a hexadecimal value? If not, how else do I declare?
My second question, is there is a better way to implement this? Please ask if you need any further info. Cheers! classes, constants, hexadecimal, enums MATLAB Answers — New Questions