Adding enumerators to classes

11 vues (au cours des 30 derniers jours)
Eoin
Eoin le 17 Fév 2011
Hi,
I'm trying to add a list of enumerators to class...see below for what i want
classdef Commodities
enumeration
Wheat (1001)
HS (1001)
end
properties
Imports
Exports
Production %same as above but dest will obviously be empty
Consumption
end
end
unfortunately, it tells me that i can't have properties and an enumeration within a class. That's not right surely, is it? Any body know a workaround without creating another enumeration class?
If it is I'll just change the enumeration to properties block with an attribute of constant.
Any help on this would be much appreciated!!!

Réponses (1)

Andrew Newell
Andrew Newell le 17 Fév 2011
I think the entry Defining Properties in Enumeration Classes will show you how to do it right.

Catégories

En savoir plus sur Software Development Tools dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by