I have java enum
package com.moc; public enum MyType { s, q, p, none, }
In matlab (2012a), load the appropriate jar and install
a = com.moc.MyType.q; a = com.moc.MyType.none;
It works. But when I try to appreciate
a = com.moc.MyType.s;
or
a = com.moc.MyType.p;
I get an exception
The class com.moc.MyType has no property or method named 's'.
and
The class com.moc.MyType has no property or method named 'p'.
Why did Matlab forbid me to get the values โโof 's' and 'p' enum?
PS
a = com.moc.MyType.q; a.getClass.getDeclaredField('p')
returns
public static final com.moc.MyType com.moc.MyType.p
UPDATE
com.moc.MyType.valueOf ('p') works. But the question remains relevant to me.
source share