From: Miguel Moura on 17 Jul 2010 07:21 Hello, Is it possible to use enumeration in Matlab? In C# an enumeration is as follows: enum Colors { Yellow, Red, Blue }; If not, is there an alternative? This is really useful and since I am using OOP and exporting Matlab code to C#. Thank You, Miguel
From: us on 17 Jul 2010 07:45 "Miguel Moura" <mdNOSPAMmoura(a)gmREMOVEail.com> wrote in message <i1s3n2$1p2$1(a)fred.mathworks.com>... > Hello, > > Is it possible to use enumeration in Matlab? > > In C# an enumeration is as follows: > enum Colors { > Yellow, > Red, > Blue > }; > > If not, is there an alternative? > > This is really useful and since I am using OOP and exporting Matlab code to C#. > > Thank You, > Miguel a hint: - for a workaround... help struct; us
From: Robert on 11 Aug 2010 14:39 "Miguel Moura" <mdNOSPAMmoura(a)gmREMOVEail.com> wrote in message <i1s3n2$1p2$1(a)fred.mathworks.com>... > Hello, > > Is it possible to use enumeration in Matlab? > > In C# an enumeration is as follows: > enum Colors { > Yellow, > Red, > Blue > }; > > If not, is there an alternative? > > This is really useful and since I am using OOP and exporting Matlab code to C#. > > Thank You, > Miguel You can use a class definition for that. Search classdef(Enumeration) in the Matlab Help for the syntx description. It is placed in the "Embedded Matlab" section, but it works fine without any additional matlab toolbox (only simulink) in my installation. Chears, Robert
|
Pages: 1 Prev: DKI levenberg marquardt Next: Mulyiply one column by another column |