How to overload the @tabular.unstack method?
6 ビュー (過去 30 日間)
古いコメントを表示
For very big tables (e.g. 1e7 x 555) unstack runs into out of memory error only due to the logical indexing in line 279:
% Explicitly fill in elements of the wide variable that received no
% tall values.
fillLocs = ~accumarray({jdx,kdx},1,[nrowsWide,nwideVars]);
wideVars_k(fillLocs) = fillVal;
This is easily solved by splitting the value and index arrays first and concatenating second (or alternative solutions). Hovewer, unstack has several dependencies on the tabular class and this class cannot serve as a superclass for custom subclasses:
classdef (AllowedSubclasses = {?timetable ?table}) tabular < matlab.mixin.internal.indexing.DotParen & matlab.internal.datatypes.saveLoadCompatibility
% Internal abstract superclass for table and timetable.
% This class is for internal use only and will change in a future release. Do not use this class.
% Copyright 2016-2019 The MathWorks, Inc.
Is there a sensible way to overload / customize unstack or to solve this use case in a different way?
0 件のコメント
回答 (1 件)
Peter Perkins
2021 年 11 月 23 日
David, if you "own" your MATLAB installation, there's nothing preventing you from directly modifying unstack.
What I'd suggest, though, is to first contact support with an example of the data that leads to the problem, and see if you can get advice on a work-around, or at least on your proposed change.
参考
カテゴリ
Help Center および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!