|
|
| File Information |
| Description |
%charcell = mtx2charcell(mtx)
% Converts a matrix of numbers into a cell array of strings of the same
% dimensionality as MTX.
%charcell = mtx2charcell(mtx,fmt)
% Uses the format string FMT (see SPRINTF for details).
%
%This function serves as a shorthand for using the built-in NUM2CELL,
%NUM2STR, and RESHAPE commands together (thanks Urs Schwarz!)
%
%EXAMPLES:
% mtx2charcell([0 1 2]) --> {'0.000000', '1.000000', '2.000000'}
% mtx2charcell([0 1 2], '%d') --> {'0', '1', '2'}
%
%This function can be handy to use in conjunction with the author's JOIN
%function (also available on Matlab Central). For example,
% join('-', mtx2charcell([0 1 2], '%d')) --> '0-1-2'
%
%CHANGES:
% 2006-02-16 6pm: even better performance enhancement, thanks to Urs Schwarz
% 2006-02-16 afternoon: performance enhancement thanks to Jiro Doke. |
| MATLAB release |
MATLAB 7.0.4 (R14SP2)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (4) |
| 16 Feb 2006 |
Jiro Doke
|
|
|
| 16 Feb 2006 |
Jiro Doke
|
|
|
| 16 Feb 2006 |
urs (us) schwarz
|
|
|
| 28 Feb 2006 |
Jiro Doke
|
|
|
| Updates |
| 17 Feb 2006 |
Added optimization inspired by Jiro Doke's suggestion. |
| 17 Feb 2006 |
Changed the implementation to expand on a suggestion by Urs Schwarz that cleans it up and keeps it fast. |
| 17 Feb 2006 |
Changed the implementation to expand on a suggestion by Urs Schwarz that cleans it up and keeps it fast. |
| 17 Feb 2006 |
Changed the implementation to expand on a suggestion by Urs Schwarz that cleans it up and keeps it fast. |
| 21 Feb 2006 |
Removed boilerplate copyright. |
|
MATLAB Central Terms of Use
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.
Contact us at files@mathworks.com