Why does removing the "sealed" attribute break the class

11 visualizaciones (últimos 30 días)
Brian Miller
Brian Miller el 4 de Mzo. de 2016
Comentada: Brian Miller el 9 de Mzo. de 2016
If I remove the "Sealed" attribute of the table class to try to subclass it, the class is then listed as unsealed in matlab, and I can create a class from it, but I get the following error when calling the table or the subclass constructor:
Method 'display' is not defined for class 'table' or is removed from MATLAB's search path.
  2 comentarios
per isakson
per isakson el 6 de Mzo. de 2016
Editada: per isakson el 6 de Mzo. de 2016
Did you edit file
... datatypes\@table\table.m
in the Matlab installation? Or did you make a copy?
Brian Miller
Brian Miller el 8 de Mzo. de 2016
I actually tried both. I editted that file, and when that didn't work, I made a copy and put it in my current folder, assuming that would supercede the original, and it seems to, but then I get the message that the display method isn't defined.

Iniciar sesión para comentar.

Respuestas (1)

Steven Lord
Steven Lord el 8 de Mzo. de 2016
We don't support subclassing the table class -- that's why it's Sealed. Perhaps if you describe what you want to do by subclassing table, we can offer suggestions for a way to achieve that goal without subclassing. Alternately, if there's functionality you believe table is missing that should be added, contact Technical Support and request that your request for this functionality be added to the enhancement request database.
  1 comentario
Brian Miller
Brian Miller el 9 de Mzo. de 2016
I wanted to create a variable that looks like a table in the edittor, and can hold the same types of data in each cell, but I wanted to also be able to add a couple of methods to it. I wanted to create a log of model runs, and be able to look at results, as well as run some comparisons or view profiler results, for example. If I am not allowed to subclass it, is there a way to create it from scratch?

Iniciar sesión para comentar.

Categorías

Más información sobre Graphics Objects en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by