problem with enumeration class
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Gopalakrishnan venkatesan
le 10 Août 2016
Modifié(e) : per isakson
le 10 Août 2016
function data
a = classenum(c,d)
end
function data will pass the two arguments c and d to classenum. classenum looks like below
classdef classenum
enumeration
Jan, Feb, March, April
end
methods
function a = classenum(c,d)
.
end
end
end
Problem is when i run the function data it is not passing the argument c and d to classenum
and i am getting the error as '' No value has been provided for the enumeration member. For an enumeration derived from a built-in class, a value must be provided for each enumeration member''.
0 commentaires
Réponse acceptée
Adam
le 10 Août 2016
You have to create an object of an enumeration class by defining the enumeration e.g.
myEnumObj = classenum.Feb;
As far as I am aware you cannot have a normal constructor taking arguments for an enumeration class.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Enumerations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!