CPRINTF
- 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

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

unfortunately, this is not possible...
you have to create the complete CELL in your loop and append it afterwards using the -fa option...
note: you could use the -Lc option to create the column labels at write-time...

So I looked at the part you mentioned and it doesn’t do what I want. I’m trying to avoid xlswrite because I have a mix of strings and numbers. Is there any way to make cprintf do the actual file output but without any spaces for padding?

This function is great for quickly and easily printing a cell array to a text file without worrying too much about format strings. But I can’t figure out how to prevent it from doing any padding with spaces. I’d like to output to a strictly tab-delimited file. I’ll probably be reading said file into excel or SPSS, so I don’t need the spaces for alignment, but I can’t figure out any way to leave them out entirely. (..., 'ntab', 1) isn’t doing it. Am I missing something, or is that functionality absent.

I quick question. If I create a column of numbers to reference the rows in my table, I would like to associate those numbers with a hyperlink. While I can perform this operation, the spacing/formatting of the column labels becomes quite ugly. Is there a simple solution?

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

22 Apr 2009

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