0

I have a c# program including a class which calls Matlab functions in their respective .m-files.

I want to create a new enumeration within one of those functions like this one which adds a new constant:

function [res msg] = addVar(handle, name, value)
...
data = Stateflow.Data(chart.Maschine);
%set data properties
data.Scope              = 'constant';
data.Name               = name;
data.DataType           = 'uint8';
data.Props.InitialValue = value;
end

like this:

function [res msg] = addEnum(handle, enumName, arrayEnumValues)
...
data = Stateflow.Data(chart.Maschine);
%set data properties
data.Scope              = 'constant';
data.Name               = enumName;
data.DataType           = 'Enum: ???';
data.Props.InitialValue = arrayEnumValues;
end

Is it possible to set a new enumeration as data object that will afterwards be available for the simulink code like the working function with the constants?

kmindi
  • 4,524
  • 4
  • 31
  • 47
  • Related question: [How do I create enumerated types in MATLAB](http://stackoverflow.com/questions/1389042/how-do-i-create-enumerated-types-in-matlab)... – Eitan T Sep 06 '12 at 12:43
  • Related question: http://stackoverflow.com/questions/7931154/defining-enumerations-and-constants-locally-in-matlab – kmindi Sep 06 '12 at 12:50

0 Answers0