View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Table class

Be the first to rate this file! 8 Downloads (last 30 days) File Size: 206 KB File ID: #43912 Version: 1.1
image thumbnail

Table class


David Legland (view profile)


15 Oct 2013 (Updated )

A class for handling data tables together with row and column labels

| Watch this File

File Information

"Table" is a class for handling flat data tables together with row and column labels. It provides functions for reading/writing from/to text files, and for quickly displaying in a uitable object. Example:
    tab ='fisherIris.txt');
    write(tab, 'tab2.txt');
Several plot functions are overloaded such that row or column labels are automatically added to the plot.
    plot(tab('PetalLength'), tab('PetalWidth'), '*');

It provides facilities to access data using name of columns. It also support basic editing features: concatenation, extraction of sub-tables...
Subtables can be obtained via parens indexing:
    tab2 = tab(1:30, :);

Table content can be accessed by curly braces indexing:
    firstSpecies = tab{1:5, 'Species'};

Raw numeric data are stored in the 'data' property, and categorical information in the 'levels' field:
    petalLength = tab('PetalLength');
    species = tab.levels{5}

Several functions are available for quick overview of data stored in Table object: summary(), min(), max()...

A "Pca" class is also provided, that allows to quiclky perform principal component analysis and to keep column names in results.

A quick overview of the features is given in the demo script.


Data Table inspired this file.

This file inspired Image M.

MATLAB release MATLAB 7.9 (R2009b)
Other requirements some functions call the statistics toolbox, but most of the features do not need it.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
25 Jun 2014 1.1

add curly braces indexing, fix bugs in

Contact us