Okay, well... this isn't the most elegant approach -- certainly not as elegant as using matlab.mixin.CustomDisplay
-- but one possibility is to try to replicate that functionality yourself, in a way that gives you more control. Here is what I hacked together on the ferry...
classdef EnumDisplay
properties
enumValue = EnumClass.enumVal1
numberValue = 1
end
methods
function disp(This)
cl = class(This) ;
fprintf(' <a href="matlab:helpPopup %s">%s</a> with properties: \n\n',cl,cl) ;
prop = properties(This) ;
len = max(cellfun(@length,prop)) ;
for ii = 1:numel(prop)
if isnumeric(This.(prop{ii}))
fmt = '%g' ;
else
fmt = '%s' ;
end
filler = char(repmat(32,1,4+len-length(prop{ii}))) ;
fprintf('%s%s: ',filler,prop{ii}) ;
fprintf(sprintf('%s \n',fmt),char(This.(prop{ii}))) ;
end
end
end
end
Result:
>> C = EnumDisplay()
C =
EnumDisplay with properties:
enumValue: enumVal1
numberValue: 1
Only catch is that this may not be fully generic because I may not have appropriately covered all of the possible formats fmt
. But if you are really desperate, maybe something like this will work.