problem with enumeration class

8 ビュー (過去 30 日間)
Gopalakrishnan venkatesan
Gopalakrishnan venkatesan 2016 年 8 月 10 日
編集済み: per isakson 2016 年 8 月 10 日
function data
a = classenum(c,d)
function data will pass the two arguments c and d to classenum. classenum looks like below
classdef classenum
Jan, Feb, March, April
function a = classenum(c,d)
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''.


Adam 2016 年 8 月 10 日
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 件)

Community Treasure Hunt

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

Start Hunting!

Translated by