Is there any way to load parts of a large table from a mat-file?

7 vues (au cours des 30 derniers jours)
MSTK
MSTK le 14 Juin 2017
Commenté : MSTK le 14 Juin 2017
I a trying to load parts of a very large table using subindexing.
f=matfile(fileName);
sub=f.X(1:10,:);
I get the following error: The variable 'X' is of class 'table'. To use 'X', load the entire variable. Why? Should I store tables in a different format than matfiles?
M
  3 commentaires
MSTK
MSTK le 14 Juin 2017
Sure, as a workaround that would do. However, the main advantage of the matfile functionality is to subindex variables that are too large to fit in memory. It seems quite strange that this is not implemented for tables.
Adam
Adam le 14 Juin 2017
There are limitations on how you can index into ordinary arrays also - e.g. you have to use contiguous indices. These limitations may cause tables to be unsupported based on how they are stored.

Connectez-vous pour commenter.

Réponse acceptée

Steven Lord
Steven Lord le 14 Juin 2017
This is one of the documented limitations of the matfile object.
" matfile does not support indexing into:
  • Variables of tables"
Since you're working with data that's too big to fit in memory, you should explore if tall arrays satisfy your needs. You can create tall table arrays as shown in the "Creating Tall Tables" section of that documentation page.
  1 commentaire
MSTK
MSTK le 14 Juin 2017
Ok, hopefully to be changed by Mathworks in a future release.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Workspace Variables and MAT Files dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by