フィルターのクリア

Unused values in enumeration classes

3 ビュー (過去 30 日間)
Iain
Iain 2013 年 8 月 20 日
I have a large set of enumeration classes. I have been told the definition for one such class (mode) as:
Init (34)
Operating (10)
Operating_NoInterrupts(18)
Sometimes, the data it applies to is invalid (stuck on an undefined value), or valid, but not specified (which looks the same). Eg.
my_actual_mode_number = 50;
mode(50)
Error using mode
Cannot find a member of the 'mode' enumeration class that corresponds to each element of the given input argument.
Obviously, I would prefer it if it was able to return an unknown value enumeration, something like "unknown?50"
Is anyone aware of a way of achieving that within the enumeration class definition rather than the far more unwieldly method of essentially doing it myself, in main code?

回答 (0 件)

カテゴリ

Help Center および File ExchangeEnumerations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by