CELL2UITABLE | Display cell array in customizable uitable

Version 1.5.0.0 (4.57 KB) by Bob Spunt
Display cell array in properly sized uitable with menu option to print to CSV
730 Downloads
Updated 4 Jul 2017

This is simple tool for presenting a cell array in a properly sized uitable. Option to customize column names and table title. Moreover, table figure menu will have the option to print the cell array to a CSV file.
USAGE: h = cell2uitable(data, varargin)
h: struct containing
.fig: handle to parent of uitable
.tab: handle to uitable
.menu: handle to uimenu (if present)
__________________________________________________________________________
NECESSARY ARGUMENT

data: cell array to present
__________________________________________________________________________
OPTIONAL ARGUMENTS

NOTE: These should be entered as ['name', value] argument pairs, which are parsed based on identifying case-insensitive matches to one of the argument names listed below. Partial matches are OK as long as only one match exists in the set of optional arguments. (For instance, 'fonts' matches only 'fontsize' below and is thus valid, whereas 'font' matches both 'fontsize' and 'fontname' and wll throw an error.) Each argument has a default value specified at the beginning of the function. To view the current defaults in the command window, run CELL2UITABLE with no arguments.

parent: handle to parent (creates new fig if empty)
colnames: cell array of column names
rownames: cell array of row names
rowstriping: 'on' | 'off'
fontsize: font size for table contents
fontname: font name for table contents
rearrangeablecols: 'on' | 'off'
oversizecolfactor: factor to mulitply auto-computed column width (useful for making all cell contents visible)
addsaveuimenu: logical flag to include/exclude uimenu for saving
editable: used to set 'ColumnEditable' property of uitable
backgroundcolor: uitable background color
foregroundcolor: uitable foreground color
emptypadsize: if >0, pads with that # empty editable rows/cols
__________________________________________________________________________
EXAMPLE USAGE

mydata = num2cell(randn(20, 3));
mycolnames = {'Col 1' 'Col 2' 'Col 3'};
myrownames = repmat({'Row 1'}, size(mydata, 1), 1);
h = cell2uitable(mydata, 'coln', mycolnames, 'rown', myrownames);

Cite As

Bob Spunt (2024). CELL2UITABLE | Display cell array in customizable uitable (https://github.com/spunt/cell2uitable), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Migrate GUIDE Apps in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes
1.5.0.0

silly typo = silly typo who?

1.4.0.0

several new optional arguments allowing customization of the created uitable
added auto column width determination for better display of cell contents
updated description

1.3.0.0

Fixed typo.

1.1.0.0

Improved input checking.

1.0.0.0

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.