<< slr_strip_blanks slr slr_xml >>

slr >> slr > slr_tabular

slr_tabular

Returns a formated tabular.

Syntax

tab = slr_tabular(title, headers, entries)
tab = slr_tabular(title, headers, entries, options)

Parameters

title

title of the table (string)

headers

headers of each column (list or matrix)

entries

entries of the table (list or matrix)

options

options for the formating (structure)

tab

formated tabular (string)

Description

This routine enables to create formated tables.

Examples

A        = rand(10,3);
data     = [mean(A,'c'),max(A,'c'),min(A,'c')];
T        = 'Table of results';
headers  = list('Mean','Max','Min');
opt.float_format = '%.3f';
opt.count_lines = %T;
tab      = slr_tabular(T, headers, data, opt);
mprintf(tab)

--> mprintf(tab)
+----------------------------+
|      Table of results      |
+----------------------------+
|    | Mean  |  Max  |  Min  |
+----+-------+-------+-------+
|  1 | 0.360 | 0.561 | 0.211 |
|  2 | 0.784 | 0.933 | 0.662 |
|  3 | 0.314 | 0.726 | 0.000 |
|  4 | 0.280 | 0.330 | 0.199 |
|  5 | 0.524 | 0.665 | 0.362 |
|  6 | 0.384 | 0.628 | 0.232 |
|  7 | 0.549 | 0.850 | 0.231 |
|  8 | 0.462 | 0.686 | 0.216 |
|  9 | 0.698 | 0.883 | 0.332 |
| 10 | 0.438 | 0.653 | 0.068 |
+----------------------------+

Report an issue
<< slr_strip_blanks slr slr_xml >>