cs0815
cs0815

Reputation: 17428

missing value or empty string in enum

Is there a way to have an enum like this:

classdef(Enumeration) bla_type < int32
    enumeration
        bla_one(1)
        bla_2(2)
    end
end

with a missing or NaN value? Thanks.

Upvotes: 1

Views: 308

Answers (1)

Ben Voigt
Ben Voigt

Reputation: 283961

NaN values apply to floating-point types, but not integers. With integers every bit pattern has a numeric meaning. With floating-point some patterns are reserved for NaNs and infinities.

Since your underlying type for your enum is int32, you won't be able to use NaN.

Upvotes: 1

Related Questions