Thread Subject: Enumeration

Subject: Enumeration

From: Miguel Moura

Date: 24 Apr, 2009 12:41:01

Message: 1 of 3

Hello,

I am using Matlab's OOP.
Can I create Enumerations or something similar as in C#?
I am using Matlab 2009a.

Thanks,
Miguel

Subject: Enumeration

From: Peter Perkins

Date: 24 Apr, 2009 13:50:34

Message: 2 of 3

Miguel Moura wrote:


> Can I create Enumerations or something similar as in C#?
> I am using Matlab 2009a.

Miguel, if you have access to the Statistics Toolbox, you may find nominal and ordinal arrays helpful, depending on what you want to do. If you're looking for a better way to store discrete data than using coded integers, or using cell arrays of strings, they may be what you want. If you're looking for a way to create named constants, perhaps this is what you're looking for:

<http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/matlab_oop/bru76zw-1.html>

Subject: Enumeration

From: David Comboni

Date: 9 Feb, 2010 10:30:05

Message: 3 of 3

Hi,
Peter Perkins wrote in message:
>
> Miguel, if you have access to the Statistics Toolbox, you may find nominal and ordinal arrays helpful, depending on what you want to do. If you're looking for a better way to store discrete data than using coded integers, or using cell arrays of strings, they may be what you want. If you're looking for a way to create named constants, perhaps this is what you're looking for:
>
> <http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/matlab_oop/bru76zw-1.html>
>
Hi,
> Miguel, if you have access to the Statistics Toolbox, you may find nominal and ordinal arrays helpful, depending on what you want to do. If you're looking for a better way to store discrete data than using coded integers, or using cell arrays of strings, they may be what you want. If you're looking for a way to create named constants, perhaps this is what you're looking for:
>
> <http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/matlab_oop/bru76zw-1.html>

Searching for an answer to enumeration I bumped out with this thread. So I would like to add a question to this one. Matlab has an option to define enumeration instanciating it with Simulink:

classdef(Enumeration) PrimaryColors < Simulink.IntEnumType
    enumeration
        Red(1),
        Blue(4),
        Yellow(8)
    end
end

Does this work when you are programming in Matlab and want to use this class?

Thanks,
David

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
enumeration David Comboni 9 Feb, 2010 05:34:05
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com