cprintf: a pedestrian ND array formatting and display utility

Version (62.5 KB) by us
cprintf converts an ND array or ND cell array to a 2D character array and - optionally - a table
Updated 11 Jun 2009

View License

- converts
an ND array of
- real and/or complex full numeric data
- real and/or complex sparse numeric data
- logical data
- char strings
- structures
- other objects
or an ND cell array of any combination of the above
to a 2D character array
- creates tables
- the input may be a cell array formatted as a table with
row/column labels and row/column separators
- any simple (ND) array can be formatted as a table using
any combination of
row/column labels and row/column separators

many options allow to format each aspect of the input and output

to better organize a project using CPRINTF
- options may be entered by an option structure
- options may be read from any ASCII file
- options may be saved in an executable m-file, which
returns an option structure

saving output
- the output may be saved in an ASCII file
- optionally, a file template may be used to insert the
result at a marked position
- tokens in a file template may be replaced by user defined
strings during runtime

CPRINTF may be a useful front end engine to create input for a spreadsheet program

> help cprintf
and the accompanying published M-file for more information and examples

> cphelp
to open the published M-file in a ML browser window

> cpdoc
to run the examples used in the published M-file

Cite As

us (2024). cprintf: a pedestrian ND array formatting and display utility (https://www.mathworks.com/matlabcentral/fileexchange/23840-cprintf-a-pedestrian-nd-array-formatting-and-display-utility), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2008b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Interactive Control and Callbacks 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!
Version Published Release Notes

user request: added an option to change default TAB/SPACE replacement behavior in CELLs; version tag 11-Jun-2009 08:58:55

options now may be read from/saved to files and entered by option structures; more help on macros; version tag 01-Jun-2009 20:57:29

the other object conversion now uses a more versatile built-in engine; version tag 22-May-2009 12:27:24

added options to create/append results to ASCII files including use of template files; version tag 21-May-2009 21:58:49

improved handling of ND arrays and ND cell arrays of other objects; version tag 21-May-2009 15:20:31

speedup for ND logical arrays; version tag 18-May-2009 14:35:01

full support for ND structures; small change in page indexing engine; version tag 16-May-2009 02:57:29

extensive changes in handling of ND arrays and ND cell arrays of mixed content including optional page index display; version tag 13-May-2009 12:40:03

formatting changes in the HTML
more help in the processing section of the HTML
the [-db] output now contains more information
change in the conversion engine for speed-up if an array only contains numeric data
version tag 22-Apr-2009 18:18:43

added more explanatory text in the published M-file and corrected some annoying typos; no change in functionality; version tag: 21-Apr-2009 20:51:35