How to display the value of an enumeration in a table, as opposed to a 1x1 array of the enumeration class?

19 views (last 30 days)
See the attached image. In my table, I have a series of asset types. Ideally, my table would display 'cash' or 'bond' instead of 1x1 Asset Type...
Is this possible?
  4 Comments
Simon Parten
Simon Parten on 8 Feb 2018
See the attached screenshot. I've also tried the custom display route for the customistation of the display inside a composite structure...
without getting anywhere!

Sign in to comment.

Answers (2)

Peter Perkins
Peter Perkins on 7 Feb 2018
Simon, I forget exactly what release (I'm guessing R2016a or b), but sometime after tables were originally released in R2014b, the display was updated to do what I think you are asking:
>> t = table(rand(3,1),[WeekDays.Monday; WeekDays.Monday;WeekDays.Tuesday])
t =
3×2 table
Var1 Var2
_______ _______
0.48976 Monday
0.44559 Monday
0.64631 Tuesday
  3 Comments
Simon Parten
Simon Parten on 8 Feb 2018
Apologies, I think I expressed the question poorly... I don't work so much with the console so didn't think to test it :-/

Sign in to comment.


Marco Norambuena
Marco Norambuena on 15 Feb 2019
Any update on this?
  3 Comments
Simon Parten
Simon Parten on 18 Feb 2019
Yes... altough the use case is to preserve some functionality implicit in the enumeration... methods etc.
It means we need a 'view' column and an 'entitiy' column... then when you get to reporting time things get a bit weird. It's a workaorund... but for me not an attractive one :-).
But thanks for posting.

Sign in to comment.

Categories

Find more on Software Development Tools in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by