Overriding table() methods and adding new

9 ビュー (過去 30 日間)
Oleg Komarov
Oleg Komarov 2016 年 1 月 23 日
編集済み: Oleg Komarov 2016 年 2 月 3 日
SETUP Win7 64b R2015b
The table() is a fundamental Matlab class which is also sealed, hence I cannot subclass it.
I want to fix some methods of this class and add new ones. For instance, table.disp() is fundamentally broken, e.g. try NOT disp(table(rand(1e7,1))), or forget the ; from time to time in the command window (the variable takes only 76 MB in RAM but the display is unbuffered and it will stall your system!).
  1. Can I override methods like table.disp() without writing into matlabroot\toolbox\matlab\datatypes\@table?
  2. Can I extend the table class with a new method under C:\MATLAB\@table\ismatrixlike.m? Why do I get
ismatrixlike(table)
Undefined function 'ismatrixlike' for input arguments of type 'table'.
Obviously, I did
addpath C:\MATLAB\
rehash toolboxcache
I also tried clear all.
The path has (alphabetic) precedence over matlabroot, but is missing a table.m class definition. If I add the same as the native table.m to C:\MATLAB\@table, then I can (after a clear all) run my new method, but:
>> methods(table)
Methods for class table:
classVarNames ismatrixlike table varfun
convertColumn renameVarNames unstack
is only listing the methods in the new \@table folder, even though the old methods still work, e.g.
istable(table)
This partly solves the problem, since now, the native \@table\private folder is not accessible anymore and therefore many native methods are broken!
=======================
Why am I doing this? Because I do not want to wait another 2 years before the table() is fixed. I already lost entire days because I simply forgot a ; in the command window and I cannot force a restart on my pc if it is running multiday simulations, but I have to wait for the disk-swap to end :(.

採用された回答

Oleg Komarov
Oleg Komarov 2016 年 2 月 2 日
編集済み: Oleg Komarov 2016 年 2 月 3 日
I adopted a solution that I fully describe on StackOverflow.
Development for a table() on steroids continues on https://github.com/okomarov/tableutils :)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTables についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by